How many abstract methods must a Java functional interface have?
Correct answer D. Exactly one
Explanation
A functional interface has exactly one abstract method, which is what a lambda expression implements. It may also have any number of default and static methods, and abstract redeclarations of public Object methods such as equals do not count. The optional @FunctionalInterface annotation asks the compiler to check this rule.
Answer checked How we write and check questions
Discussion