Java LinkedBlockingDeque contains() MethodThe contains() method is used to check the presence of the specified element in the deque. If the element is present in the deque, then this method returns true otherwise it returns false. Syntax:Parameters:o - this is the object that is to be checked for occurrence in this deque. Specified By:The contains() method of LinkedBlockingDeque class is specified by:
Override:The contains() method of class LinkedBlockingDeque is overridden by contains() method in class AbstractCollection<E>. Return Value:The contains() method returns true if the defined element is present in this deque. Example 1Test it NowOutput: Himanshu Rahul Rita Ramesh queue.contains( Himanshu) will return true Example 2Test it NowOutput: Harshit is present. Next TopicJava Linkedblockingdeque |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India