Wednesday, July 1, 2015

Java 8 | Lambda Expressions


What is lambda expression for?


It is another way of writing instances of anonymous classes

If we have more than one line of code, use lambda expression in this way

If we have more than one argument, use lambda expression in this way


 What is the type of Lambda expression?

It’s a functional interface (the interface contain only one abstract method)
A Lambda can be taken as a method parameter, and can be returned by a method 
Lambda expression is “not an obect” because we can’t call any method in object class like hashCode(),toString() , but the exact answer is an object without identity 



No comments:

Post a Comment