Java Deque peekLast() MethodThe peekLast() method of Java Deque Interface retrieves and not remove the last element of the given deque. But, if the deque is empty, it may return null. Syntax:Parameter:NA Return:The above method is used to return the tail of the given deque. On the other hand, if the deque is empty, the method may return null. Example 1Test it NowOutput: The last character is given as : A The final deque is given as : J A V A Example 2Test it NowOutput: The last string value is given as : language The final deque is given as : [Java, is, a, secured, language] Example 3Test it NowOutput: The last integer value is given as : 5 The final deque is given as : 1 2 3 4 5 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