Functional Interfaces
A functional interface in Java is any with @FunctionalInterface annotation and with SAM(Single Abstract Method). It was introduced to facilitate Lambda expressions. Since a lambda function can only provide the implementation for one method, it is mandatory for the functional interfaces to have only one abstract method. Java has defined a lot of functional interfaces in java.util.function package. Some of them are Consumer, Supplier, Function and Predicate.
Basic Functional Interfaces Special Functional Interfaces Consumer has an accept(Object) method and represents an operation that accepts a single input argument and returns no result.
[Read More]