Package modernfeatures.lambda
Class LambdaExample
java.lang.Object
modernfeatures.lambda.LambdaExample
Class: LambdaExample
----------------------
Demonstrates how Java 8 Lambda expressions simplify the creation
of functional interface implementations.
Instead of using an anonymous inner class, we directly assign
a lambda expression to the interface.
NOTE:
This works because Greeting2 is a Functional Interface — it has exactly one abstract method.
The compiler can safely map the lambda expression to that method.
If there were multiple abstract methods, this would not be allowed.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
LambdaExample
public LambdaExample()
-
-
Method Details
-
main
-