Lambda expressions - process-oriented programming ideas

First, the use of anonymous inner classes are anonymous objects to create threads and Lambda expressions wording

 

Lambda expressions are written do not have to define a class that implements Runable interface;

Second, the method is implemented into the reference class or interface to an interface

 

Third, some of the objects instance of a class to sort

Among them, the array is created when using static initialization, the object is stored inside an anonymous object;

Lambda expressions wording:

 

Four, and the number of two is calculated, the method of the reference is an interface

 

Five, Lambda expressions written context may be omitted derived

 Into the reference list and only one; parameter list in parentheses may be omitted (the type parameter may be omitted in the list of parameters in all cases)

The method of one-line body: Method body braces, semicolons, and return the back end of the line of code, which must be omitted altogether three;

 

 

Guess you like

Origin www.cnblogs.com/wmqiang/p/11373285.html