What is Functional Interface? The functional interface is the only base for Lambda expression that is the lambda expression provides the implementation for the functional interface. The functional interface is a special type of interface that only contains a single abstract method and it is also known as SAM interface. In addition to a single abstract method, you can define any number of default and static methods within the functional interface. Examples of a functional interface are all the interfaces present inside the package java.util.function and all those interfaces which are already present before Java 8 with a single abstract method like Runnable, Callable, Comparable, Comparator, etc. What does @FunctionalInterface annotation? The @FunctionalInterface annotation can guarantee that the interface has the only single abstract method and additionally it gives you an indication that this interface is a functional interface. It is like @Override annotation, which indicat...
Eat Sleep Code Repeat.