Java Deque pollLast() MethodThe 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. Syntax:Parameter:NA Return: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 NowOutput: The last string is given as : World The remaining deque is : [Hello, ] Example 2Test it NowOutput: The last float value is given as : 98.0 The remaining deque is : [24.0, 56.9] Example 3Test it NowOutput: The LAST character value is given as : S The final deque is given as : I N D I A N Next TopicJava Deque |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India