filmov
tv
What is a FunctionalInterface in Java?

Показать описание
A FunctionalInterface in Java is an interface that has exactly one abstract method. It can have multiple default or static methods, but only one abstract method. Functional interfaces are the foundation of lambda expressions and method references in Java.
Key Points:
1. Defined with the @FunctionalInterface annotation (optional but recommended).
2. Allows usage of lambda expressions.
3. Can have default and static methods.
Key Points:
1. Defined with the @FunctionalInterface annotation (optional but recommended).
2. Allows usage of lambda expressions.
3. Can have default and static methods.