This is from one question about lambda expression. I'm baffled with the syntax in line check((h, l) -> h > l, 0);:
The check() function requires a Climb object and an int. The line above does not provide any Climb object. And what does h > l, 0 mean?
interface Climb {
boolean isTooHigh(int height, int limit);
}
class Climber {
public static void main(String[] args) {
check((h, l) -> h > l, 0);
}
private static void check(Climb climb, int height) {
if (climb.isTooHigh(height, 1))
System.out.println("too high");
else
System.out.println("ok");
}
}