BinaryOperator Functional Interface Java Examples

In this post we’ll see examples of Java java.util.function.BinaryOperator functional interface. BinaryOperator functional interface represents an operation upon two operands of the same type, returning a result of the same type as the operands. BinaryOperator extends java.util.function.BiFunction interface and provides behavior for the case where the operands and the result…

Continue reading

UnaryOperator Functional Interface Java Examples

In this post we’ll see examples of Java java.util.function.UnaryOperator functional interface. UnaryOperator functional interface represents an operation on a single operand returning a result of the same type as its operand. UnaryOperator extends java.util.function.Function interface and provides behavior for the case where the operand and result are of the same…

Continue reading

LinkedBlockingQueue in Java With Examples

LinkedBlockingQueue in Java is an implementation of BlockingQueue interface and is part of java.util.concurrent package. LinkedBlockingQueue has the features of both ArrayBlockingQueue and DelayQueue. ArrayBlockingQueue is a bounded blocking queue where as DelayQueue is an unbounded blocking queue. LinkedBlockingQueue sits in the middle as it is an optionally-bounded blocking queue…

Continue reading

Predicate Functional Interface Java Examples

In this post we’ll see examples of java.util.function.Predicate functional interface. Table of contents Methods in Predicate interface Predicate interface test() method example Predicate functional interface and() method example Predicate functional interface or() method example Predicate functional interface negate() method example Predicate functional interface in JDK Methods in Predicate interface Predicate…

Continue reading