The Lambda operator -
suggest changeFrom Java 8 onwards, the Lambda operator ( -> ) is the operator used to introduce a Lambda Expression. There are two common syntaxes, as illustrated by these examples:
a -> a + 1 // a lambda that adds one to its argument
a -> { return a + 1; } // an equivalent lambda using a block.
A lambda expression defines an anonymous function that can be used where an instance of a functional interface is required. It is not an instance of an anonymous class.
(This example is included here for completeness. Refer to the Lambda Expressions topic for the full treatment.)
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents