LinkedTransferQueue contains() method in Java
The contains() method of java.util.concurrent.LinkedTransferQueue is an in-built function in Java which returns a true boolean value if the specified element is present in this queue otherwise it returns false.
Parameters: The function accepts a single parameter o i.e. to be checked for the presence in this queue.
Return Value: The function returns a Boolean value. It returns True if the specified element is present in this queue else it returns False.
Below programs illustrate the LinkedTransferQueue.contains() method:
9 is not present in the queue.
Gfg is present in the queue.
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.