26

深度分析:java8的新特性lambda和stream流,看完你学会了吗?-前程有光的博客

 3 years ago
source link: https://blog.51cto.com/14801695/2510703
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
1.lambda表达式1.1什么是lambda以java为例,可以对一个java变量赋一个值,比如inta=1,而对于一个方法,一块代码也是赋予给一个变量的,对于这块代码,或者说被赋给变量的函数,就是一个lambda表达式//为变量赋值inta=1;//将代码块赋值给变量var=publicvoidfun(intx){x+1;}//可以简化var=(x)->x+1;1.2java为什么要引入

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK