Kotlinlearncs.online LogoJava
Return to List

Homework: Adder with Lambda

Created By: Geoffrey Challen
/ Version: 2020.10.0

Declare a public class Modifier providing one static method 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!

Related Lessons

Stuck? You may find these lessons helpful: