posted 6 days ago
I'm working through Bonus Exam # 2, a question about lambdas, and according to what they reported, E and F are reversed. In other words, the authors' answer is correct, but the software graded it incorrectly. This is the solution to the question which might help you identify it:
"C, F.
Since the interface doesn’t take any parameters, we need to pass an empty parameter list. Option A is incorrect because it does not specify a parameter list. Options B and D are incorrect because they pass one parameter. Option E is incorrect because the return keyword is missing."
But while E is missing the return keyword, when graded, it tells me it is okay, and F, where there is the return keyword, is incorrect. That's backwards.
E. caller((0) -> {5});
F. caller((0) -> {return 5;});
I don't know if you have control over the software glitch that grades it, but they have it wrong. Your answer is correct, though.
m.