How to check if ArrayDeque contains element in Java ?


Declaration :

Explanation :

Purpose The java.util.ArrayDeque.contains(Object) returns true if this deque contains the specified element.
Parameters o ===> The object to be checked as contained in deque.
Return Value This method returns true if this deque contains the specified element else false.
Exception NA

Java Program : Example

Below example will explain java.util.ArrayDeque.contains() method.

Output of Program :