Java 8 UnaryOperator Examples
In Java 8, UnaryOperator is a functional interface and it extends Function. The UnaryOperator takes one argument, and returns a result of the same type of its arguments. The Function…
Favourite tutorials for developers
In Java 8, UnaryOperator is a functional interface and it extends Function. The UnaryOperator takes one argument, and returns a result of the same type of its arguments. The Function…
In Java 8, BinaryOperator is a functional interface and it extends BiFunction. The BinaryOperator takes two arguments of the same type and returns a result of the same type of…
In Java 8, BiConsumer is a functional interface – BiConsumer<T, U>; it takes two arguments and returns nothing. Further Reading – Java 8 Consumer Examples 1. BiConsumer JavaBiConsumer1.java Output 2.…
In Java 8, Supplier is a functional interface; it takes no arguments and returns a result. We can use Supplier to return some values or to build factory method in…
In Java 8, Function is a functional interface; it takes an argument (object of type T) and returns an object (object of type R). The argument and output can be…
In Java 8, BiFunction is a functional interface - BiFunction; it takes two arguments and returns an object. T – Type of the first argument to the function. U –…
In Java 8, the double colon (::) operator is called method references. There are four kinds of method references: 1 - Reference to a static method ClassName::staticMethodName, 2 - Reference…
In Java 8, BiPredicate is a functional interface, which accepts two arguments and returns a boolean, basically this BiPredicate is same with the Predicate, instead, it takes 2 arguments for…
In Java 8, Predicate is a functional interface, which accepts an argument and returns a boolean. Usually, it used to apply in a filter for a collection of objects.
In Java 8, Consumer is a functional interface; it takes an argument and returns nothing. It can act as Higher Order Function, so we can accepts Consumer as an argument,…