Java Deque pollLast() Method
The pollLast() method of Java Deque Interface is used to retrieve and remove the last element of the deque. The method may return null if the given deque is empty.
The above method is used to return the tail of the deque. On the other hand, if the deque is empty, the method may return null.
Example 1Test it Now
The last string is given as : World The remaining deque is : [Hello, ]
Example 2Test it Now
The last float value is given as : 98.0 The remaining deque is : [24.0, 56.9]
Example 3Test it Now
The LAST character value is given as : S The final deque is given as : I N D I A N