1.

What is the syntax and characteristics of a Lambda Expression in JAVA 8?

Answer»

The syntax for the Lambda expression is:-

parameter -> expression body

Characteristics of the Lambda Expression:-
  • No need to DECLARE the parameter TYPE as the compiler will get the STANDARD by the VALUE of the parameter.
  • For the multiple parameters PARENTHESIS has to be declared, but for the simple parameter, parenthesis need not be declared.
  • If a contains only a single parameter, then there is no need of curly braces.
Related Article: How should I start JSP and Servlet


Discussion

No Comment Found