写法:(参数)->结果
(String s)-> s.length()
是接口或接口函数的一种简写方法。
double fun(double x)
{
return Math.sin(x);
}
相当于
@FunctionalInterface //注记
x->Math.sin(x)
写法:(参数)->结果
(String s)-> s.length()
是接口或接口函数的一种简写方法。
double fun(double x)
{
return Math.sin(x);
}
相当于
@FunctionalInterface //注记
x->Math.sin(x)