LinkedTransferQueue isEmpty() method in Java
The isEmpty() method of java.util.concurrent.LinkedTransferQueue is an in-built function in Java which checks if this queue is empty or not.
Return Value: The function returns a boolean value. It returns true if the LinkedTransferQueue is empty and returns false otherwise.
Below programs illustrate the LinkedTransferQueue.isEmpty() method:
Program 1: In this program the LinkedTransferQueue is non-empty.
The queue is non-empty.
Program 2:In this program the LinkedTransferQueue is empty.
The queue is empty.
Attention reader! Don’t stop learning now. Get hold of all the important Java Foundation and Collections concepts with the Fundamentals of Java and Java Collections Course at a student-friendly price and become industry ready. To complete your preparation from learning a language to DS Algo and many more, please refer Complete Interview Preparation Course.