Practice mode Java

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.

Report a problem

Answer checked How we write and check questions

Tip: press A, B, C or D to answer, and N for the next question.

Advertisement

Have a question about this answer?

Your email address will not be published. Required fields are marked *

Links and website addresses are not allowed in comments.