Java Deque removeFirst() Method
The removeFirst() method of Deque interface is used to retrieve and removes the first element of the given deque. The above method is different from the pollFirst() method such that it throws an exception if the given deque is empty.
The above method is used to return the head of the given deque.
NoSuchElementException- If the given deque is empty.
Example 1Test it Now
The removed string is : Welcome The resultant deque is : to our site
Example 2Test it Now
The removed integer value is : 66 The resultant deque is : 11 33 44
Example 3Test it Now
The removed long value is : 11 The resultant deque is : 88 22 99