Lambda Expressions in Java 8

Yogesh Bali
1 min readAug 5, 2019

--

Functional Interfaces contains only one abstract method. Example: Runnable contains only one method run, Callable contains only one method call.

Lambda expressions can be used with interfaces which have only one abstract function and therefore they are used for functional interfaces.

  • They enable us to pass functionality/logic as a method argument in same manner as we pass data in method arguments. Hence, it allows functional programming in java.
  • The implementation of abstract function can be provided without belonging to any class.
  • They reduces the lines of code, makes the code more readable.
  • They helps in writing the parallel processing and in consuming the API’s easily

--

--

Yogesh Bali
Yogesh Bali

Written by Yogesh Bali

Senior Technical Lead in Thales

Responses (1)