A lambda expression is a concise way to represent an anonymous function.
It allows you to define a method implementation inline with your code.
Notes:
- A lambda consists of the Parameter List, the Arrow Operator (->) and the body.
- A lambda expression is backed by a functional interface, this is an interface with a single method.
Examples of functional interfaces in Java are Runnable, Predicate, Consumer, Supplier and Function.
- Lambda expressions are often used in Java streams.