Lambda Method:- A Lambda method don’t need to define the method again for providing the implementation.it is a short block of code which takes in parameters and returns a value.
interface PrintHello {
public void print();
}
public class LambdaEx {
public static void main(String[] args) {
PrintHello n = new PrintHello() {
public void print() {
System.out.println("printing...........");
}
};
n.print();
PrintHello m = () -> {
System.out.println("well");
};
m.print();
}
}
Output:-
printing………..well