beyondgrader.com Logo
DemoBrowseAboutTeamLogin

Subtracter with Lambda

Geoffrey Challen // 2021.2.0

Declare a method named subtracter. subtracter takes a single Int parameter and returns a method that implements the Modify functional interface:

The returned "function" should implement modify so that it returns the argument passed to subtracter minus the argument to modify. So, for example:

The correct solution to this problem is a single line lambda expression!