If your applications require many implementations of functional interfaces, you would have to create many named classes or inline many anonymous class implementations. This would make your code excessively large and difficult to read. Fortunately, Java 8 has provided lambda expressions to represent functional interfaces using a very succinct syntax.
© Ralph Lecessi 2019
Ralph LecessiFunctional Interfaces in Javahttps://doi.org/10.1007/978-1-4842-4278-0_22. Lambda Expressions
Ralph Lecessi1
(1)
Kendall Park, NJ, USA
A lambda expression is used to represent a statement. They were introduced in Java 8 to support functional programming. The basic form of a lambda expression is the following:
lambda_argument_list ...
Get Functional Interfaces in Java: Fundamentals and Examples now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.