Java LinkedTransferQueue contains() Method

The contains() method of LinkedTransferQueue class returns a Boolean value true if the specified element is present in this queue.

Syntax:

Parameters:

o - It is the object that is to be checked for the presence in this queue.

Specified By:

The contains() method of LinkedTransferQueue class is specified by:

  • contains() method in interface Collection.
  • contains in interface BlockingQueue

Override:

The contains() method of class LinkedTransferQueue is overridden by:

  • contains() method in class AbstractCollection.

Return Value:

The contains() method returns the Boolean value true if the specified element is present in this queue else it returns false.

Example 1

Test it Now

Output:

1.Jack
2.Harry
3.Kristan
4.John
John is present

Example 2

Test it Now

Output:

Your answer is correct.

Example 3

Test it Now

Output:

Marry is present on 31.08.18





Latest Courses