分类 默认分类 下的文章

匿名内部类的调用
https://www.bilibili.com/video/BV1Gh41187uR?p=6&spm_id_from=pageDriver&vd_source=8a97a93caad7a94090d3afb6a8de7574

Lambda关键词:

 alt+回车

Lambda就是优化匿名内部类的

public main (){
   int i=calculateNum(new IntBinaryOperator(){
    @Override
    public int applyAsInt(int left,int right){
     return left+right;
   } 
  })

  
}

public static int calculateNum(IntBinaryOperator intBinaryOperator){
  int a=10;
int b=20;
return intBinaryOperator.applyAsInt(a,b);
 }

修改成lambda

 public main (){
   int i=calculateNum((int left,int right)->{
     return left+right;
   } 
  })

  
}

public static int calculateNum(IntBinaryOperator intBinaryOperator){
  int a=10;
int b=20;
return intBinaryOperator.applyAsInt(a,b);
 }

=CONCATENATE("update dr_logistics_class set total_freight='",B2,"', total_order_num='",C2,"', weight='",D2,"' where class_code='",A2,"' ;")