RemoveFirst() Method : ArrayDeque in Java

   

Declaration :

Explanation :

Purpose The java.util.ArrayDeque.removeFirst() method retrieves and removes the first element of this deque.
Parameters NA
Return Value This method returns the head (first element) of this deque.
Exception NoSuchElementException — if this deque is empty.

Java Program : Example

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

Output of Program :