2 Replies Latest reply on Feb 25, 2014 11:42 PM by msnaidu

    What is main use of Lambda Expressions in Java8?

    msnaidu

      I have gone through the Oracle tutorial on Lambda Expressions. But i didn't understand what problems will it solve really. Can you some one help me understanding the use cases of Lambda Expressions? Apart from simplifying coding(number of lines of code), what other problems does Lambda Expressions solve?

        • 1. Re: What is main use of Lambda Expressions in Java8?
          abhijithtn

          Lambda Expressions for Java is specified by JSR 335, which speaks about below topics.

          • Part A: Functional Interfaces: Provides a definition of functional interfaces, which lambda expressions and method references can be used to instantiate.
          • Part B: Lambda Expressions: Defines the syntax of lambda expressions, including rules for the new kinds of parameter lists and statement lists.
          • Part C: Method and Constructor References: Defines the syntax of method and constructor references.
          • Part D: Poly Expressions: Describes poly expressions, which are a category of expressions that can adapt their typing to conform to a particular context.
          • Part E: Typing and Evaluation: Specifies the typing rules and evaluation behaviour of lambda expressions, method references, and constructor references.
          • Part F: Overload Resolution: Adapts overload resolution to handle lambda expressions and other poly expressions
          • Part G: Type Inference: Redefines type inference to support lambda expressions, method references, and constructor references, and to allow context to be pushed down to nested poly expressions.
          • Part H: Default Methods: Describes the syntax and inheritance behaviour of default methods, which are members of interfaces.

           

          I feel, the improvement lambda expressions brings by removing the verbose syntax itself is one of the major advantages.

           

          Lambda with Streams makes a stunning combination for Java.

           

          Oracle tutorial on Lambda expressions, though lists everything, but fails to impress the reader due to lack of organization.

           

          Probably, you could start with the below link. The tutorial is basic but makes it easier to understand.

           

          http://www.dreamsyssoft.com/java-8-lambda-tutorial/

           

          Let me know if you need more information.

          1 of 1 people found this helpful
          • 2. Re: What is main use of Lambda Expressions in Java8?
            msnaidu

            Thanks for the info