January 2018
Intermediate to advanced
115 pages
1h 37m
English
Java 8 introduced the lambda expression , which provides a concise way to represent a method using an expression. A lambda expression consists of three parts: an argument list, the arrow operator (->), and a body. The following lambda takes two integer arguments and returns their sum:
The parameter types generally don’t need to be specified because the compiler can determine these types automatically. This type inference also applies to the return type. If the body contains only a single statement, you can leave out the curly brackets, ...