Introduction:
Java 8 is first released in 2014 and introduced lot of new features. Lambda expressions are the most significant change in java 8 version.
As of java 7, Oracle/Sun people have given importance to the object oriented programming languages but in java 8, they have introduced functional programming to compete with other programming languages such as Scala, C# etc.
As of java 7, Oracle/Sun people have given importance to the object oriented programming languages but in java 8, they have introduced functional programming to compete with other programming languages such as Scala, C# etc.
What is Lambda Expression?
Any function which is having no name is called as Lambda expression. Which is also called as anonymous function.
Rules:
1) function should not have access modifier
2) Should not have any return type (even void also not allowed)
3) Should not have name for function
4) Should use arrow symbol "->"
We will see now a few examples how to convert normal java fucntions to lambda expression.