Skip to main content

Posts

Lambda Expression in java

 Java Lambda Expression            Lambda expression provided implementation logic for functional interfaces (interfaces with only one abstract method ) which we will discuss soon. lambda expression add the essence of functional programming in java . They are functional constructs without classes, which can be passed like objects and executed as required. They also make the modifires, return type and parameter types completely optional. Syntax of Lambda Expression (arguments) - > ( body ) the syntax of lambda expressions is comprised of three parts: An  argument list :    The parameter list should be the same (in terms of number, type, and order of arguments) as that of the abstract method of the interface. For example: Syntax: () -> { System.out.println("No argument"); } OR (int argument1, String argument2) -> { System.out.println("Multiple arguments"); }     Argument types can be eliminated, making them inferred ty...