Preskočiť na hlavný obsah

Príspevky

Zobrazujú sa príspevky z dátumu september, 2011

Lambda Expressions for Java

Lambda expressions are similar to anonymous methods introduced in C# 2.0, except that lambda expressions are more concise and more flexible. All lambda expressions use the lambda operator -> which is read as “goes to”. The left side of the lambda operator specifies the input parameters and the right side holds the expression or statement block. Here is an example of lambda expressions:   x  ->  x + 1 JSR 335: Lambda Expressions for the JavaTM Programming Language: Extend the Java language to support compact lambda expressions (closures), as well as related language and library features to enable the Java SE APIs to use lambda expressions effectively.