Avijit Pramanik's Blog

Avijit Pramanik's Blog

Java 8

Functional Interface in Java

A Functional Interface can have only one abstract method. Now the question can arise that why we need an interface which can have only one abstract method, the answer is, on every occasion we create an Interface for a purpose and that is to have multiple implementation for it which can be dynamically passed where the Interface reference is used. Functional Interface can also has the same ability in a greater way where we can pass any method which has the signature identical to the single abstract method that is contained by the Functional Interface. Since any method can be passed where the interface is used, so there is no need for creating unnecessary classes which need to implement that interface.

Functional Interface in Java Read More »