Adder with Lambda
Declare a function named adder
.
adder
takes a single Int
parameter and returns a method that implements the Modify functional interface:
The returned "function" should implement modify
so that it adds the value passed to adder
.
So, for example:
The correct solution to this problem is a single line lambda expression!