lambda表达式

来源:互联网 发布:淘宝半自动机器人 编辑:程序博客网 时间:2024/05/22 00:53

写法(参数)->结果

String s)-> s.length()

是接口或接口函数的一种简写方法。

double fun(double x){    return Math.sin(x);}

相当于

@FunctionalInterface    //注记x->Math.sin(x)
0 0
原创粉丝点击