What is lambda expression in java?
A lambda expression (lambda) describes a block of code (an anonymous function) that can be passed to constructors or methods for subsequent execution. The constructor or method receives the lambda as an argument. Consider the following example:
System.out.println(“Hello”)
This example identifies a lambda for outputting a message to the standard output stream. From left to right, () identifies the lambda’s formal parameter list (there are no parameters in the example), -> indicates that the expression is a lambda, and System.out.println(“Hello”) is the code to be executed.
🔗Source: stackoverflow.com
🔗Source: Java Interview Questions and Answers