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

Abstract Class in Java

Abstract class in Java is a class that is declared using abstract keyword. Abstract class can have regular methods (methods with method body) as well as abstract methods (methods without method body and having abstract specifier). Table of contents General form of abstract class in Java When is abstract class…

Continue reading

Interface in Java

Interface in Java helps to fully abstract the implementation of the class. Interfaces act as a contract for the class, detailing what methods can be invoked by any outside entity without actually providing what methods should do. The class implementing an interface has to provide the behavior (implement the methods…

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