Java LinkedBlockingDeque getLast() methodThe getLast() method of LinkedBlockingDeque class returns the last element of this deque but does not withdraw it. Syntax:Parameters:NA Specified By:The getLast() method of LinkedBlockingDeque class is specified by getLast() method in interface Deque<E>. Return Value:The getLast() method returns the last element of this deque. Throws:The getLast() method throws NoSuchElementException, if this deque is empty. Example 1Test it NowOutput: Last element in the Queue is : Janak Example 2Test it NowOutput: Exception in thread "main" java.util.NoSuchElementException at java.util.concurrent.LinkedBlockingDeque.getLast(Unknown Source) Next TopicJava Linkedblockingdeque |
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