Functional Interface
Functional Interface
- As we know interface is a blueprint of a class. It has static constants and abstract methods. A Functional Interface is an interface that only has one abstract method. Interface methods are by default public, and abstract. Thus it is not required to add
public abstract int sum(int a, int b);
In java, Runnable is a Functional Interface that has only arun
method.
@FunctionalInterface
interface GetSummation{
int sum(int a, int b);
}