Question
Which statement about Lambdas and Functional Interfaces is the strongest interview answer?
- Lambdas and Functional Interfaces is mostly a naming style choice and has little effect on runtime or design.
- Lambdas and Functional Interfaces exists mainly to reduce the number of Java files in a project.
- Lambdas and Functional Interfaces matters only for frontend frameworks, not for core Java applications.
- A lambda provides an implementation for a functional interface, which has exactly one abstract method.
Hint
Start with the core rule behind Lambdas and Functional Interfaces.
Answer and rationale
Correct answer: D. A lambda provides an implementation for a functional interface, which has exactly one abstract method.
A lambda provides an implementation for a functional interface, which has exactly one abstract method. This is the base concept interviewers commonly test first.
Track: Java