1.lambda表达式
(参数)->{表达式}
中括号表达短的话可以没有
如
( String first , String second ) - >
{
if ( first . length() < second . length() ) return - 1 ;
else if ( first . length() > second . length() ) return 1 ;
else return 0 ;
}
Java核心技术_笔记6-4
猜你喜欢
转载自blog.csdn.net/Matrix576/article/details/82563866
今日推荐
周排行