Clear() Method : Remove All elements in ArrayDeque in Java

   

Declaration :

Explanation :

Purpose The java.util.ArrayDeque.clear() method removes all of the elements from this deque.
Parameters NA
Return Value This method does not return any value.
Exception NA

Java Program : Example

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

Output of Program :