Engineering Full Stack Apps with Java and JavaScript
Java 8 introduces few general purpose functional interfaces based on the input and output to the single abstract method.
Most common ones are:
Predicate<T> whose method
takes in an argument of type T and
rerturn a boolean.
Consumer<T> whose method
takes in an argument of type T and
rerturn nothing (void).
Function<T,R> whose method
takes in an argument of type T and
rerturn type R.
Supplier<T> whose method
takes no arguments and
rerturn type T.
UnaryOperator<T> whose method
takes in an argument of type T and
rerturn type T.
BinaryOperator<T,T> whose method
takes in an argument of type (T,T) and
rerturn type T.
Provide sImple examples for each of these.