Tuesday, April 20, 2021

Functional interface in Java SE 8+ = an interface with 1 abstract method (not derived from Object class)

Sources:



Functional interface in Java SE 8+ = an interface with 1 abstract method (not derived from Object class). 
Abstract method means with no body and not implemented.
We can also tell the compiler to treat it as a @FunctionalInterface with this annotation.

Default methods of such interfaces (with "default" keyword) are implemented with body here, and are not abstract since Java SE 8.

No comments: