Open In App

ConcurrentLinkedDeque contains() method in Java with Examples

Last Updated : 11 Jul, 2025
Comments
Improve
Suggest changes
8 Likes
Like
Report
The java.util.concurrent.ConcurrentLinkedDeque.contains() method is an inbuilt method in Java which checks if the specified element, passed as a parameter, is present in the deque or not. Syntax:
public boolean contains(Object elem)
Parameters: The method accepts a parameter elem which checks if the specified element is present in the deque or not. Return Value: The function returns True if the element is present in the deque and returns False otherwise. Below programs illustrate the ConcurrentLinkedDeque.contains() method: Program 1:
Output:
ConcurrentLinkedDeque: [Welcome, To, Geeks, 4, Geeks]
GFG is not present
Program 2:
Output:
ConcurrentLinkedDeque: [Welcome, To, Geeks, 4, Geeks]
Geeks is present
Reference: https://docs.oracle.com/javase/9/docs/api/java/util/concurrent/ConcurrentLinkedDeque.html#contains-java.lang.Object-

Article Tags :
Practice Tags :

Similar Reads