© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2022
J. Juneau, L. ManelliJava 17 Recipeshttps://doi.org/10.1007/978-1-4842-7963-2_6

6. Lambda Expressions

Josh Juneau1   and Luciano Manelli2
(1)
Hinckley, IL, USA
(2)
TARANTO, Taranto, Italy
 

A convenient way to create anonymous functions is using the lambda expressions using an expression or series of statements. Lambda expressions are built on functional interfaces, which contain a single abstract method, and that method has no implementation.

They can be applied in many contexts, ranging from simple anonymous functions to sorting and filtering collections. Moreover, lambda expressions can be assigned to variables and then passed into other objects.

In this chapter, ...

Get Java 17 Recipes: A Problem-Solution Approach 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.