April 2019
Intermediate to advanced
360 pages
9h 17m
English
Our example implementation of lambda with multiple parameters will consist of the FunctionalGift interface that is provided next. We will also have a Driver class that accepts user input for two types of tokens (blue and red), implements basic math, and then provides a random gift to the user who submitted the tokens. Here is the FunctionalGift interface:
public interface FunctionalGift { void abstractMethod(int number);}
Our implementation's Driver class is presented in five sequential sections. The first section, provided next, includes two import statements—java.util.Random and java.util.Scanner. We will use the Scanner class in the second section of the code and the Random class in the fifth ...
Read now
Unlock full access