April 2019
Intermediate to advanced
360 pages
9h 17m
English
To demonstrate use of the lambda design pattern, we will create a functional interface and a main Driver class. The functional interface will contain an abstract method with a single int parameter. Here is that interface:
public interface FunctionalGift { void abstractMethod(int number);}
The FunctionalGift interface is a functional interface because it has only one abstract method.
The Driver class provided next contains the main() method for our program. That method contains a lambda expression that implements the FunctionalGift interface. The interface implements the abstractMethod() method by default. Our myObject.abstractMethod() ...
Read now
Unlock full access