0 votes
in JAVA by
What is lambda expression in java?

1 Answer

0 votes
by

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

Related questions

+2 votes
asked Feb 8, 2020 in JAVA by rahuljain1
0 votes
0 votes
0 votes
asked Feb 28, 2023 in JAVA by rajeshsharma
...