Poll() Method : Java.util.ArrayDeque

   

Declaration :

Explanation :

Purpose The java.util.ArrayDeque.poll() retrieves and removes the head of the queue represented by this deque.Returns null if this deque is empty.
Parameters NA
Return Value This method returns the head of the queue represented by this deque or null if this deque is empty.
Exception NA

Java Program : Example

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

Output of Program :