Java LinkedBlockingDeque descendingIterator() method21 Mar 2025 | 2 min read The descendingIterator() method of LinkedBlockingDeque class returns an iterator over the elements of this queue. The elements are returned in the reverse sequential order. Syntax:Parameters:NA Specified By:The descendingIterator() method of LinkedBlockingDeque class is specified by descendingIterator() method of interface Deque<E>. Return Value:The descendingIterator() method returns an iterator across the elements of this deque in reverse order. Example 1Output: Ramesh Rita Rahul Reema Example 2Output: Characters : [A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,] After reversing the characters : [Z,Y,X,W,V,U,T,S,R,Q,P,O,N,M,L,K,J,I,H,G,F,E,D,C,B,A,] Example 3Output: 1..Roll No. = 17cs1029 College = MR University Name = Vineet 2..Roll No. = 15cs1010 College = MVN University Name = Geetanjali 3..Roll No. = 15cs1029 College = MVN University Name = Reema Next TopicJava Linkedblockingdeque |
Java LinkedBlockingDeque method The method of LinkedBlockingDeque class inserts the specified element at the front of this LinkedBlockingDeque. This method throws IllegalStateException if the specified element is null. Syntax: public Boolean addFirst(E e) Parameters: e- It is the element to add Specified By: The method of ConcurrentLinkedQueue class is...
1 min read
Java LinkedBlockingDeque Method The method of LinkedBlockingDeque class retrieves this deque's last element, but doesn't remove it. The method returns null if this deque is empty. Syntax: public E peekLast () Parameters: NA Specified By: The peekLast () method of LinkedBlockingDeque class is specified by method in interface Deque<E>. Return...
3 min read
Methods class provides several methods like addFirst(), add(), clear(), element(), getLast(), peek(), etc. addFirst() add() addAll() addLast() clear() contains() descendingIterator() drainTo() element() getFirst() getLast() iterator() offerFirst() offerLast() offer() peek() peekFirst() peekLast() pollFirst() pollLast() poll() pop() TopicLinkedblockingdeque addFirst() ...
1 min read
Java LinkedBlockingDeque Method The method of LinkedBlockingDeque class adds the defined elements at the end of this deque, only if the deque's capacity allows so. Syntax: public boolean offerLast(E e) public boolean offerLast(E e, long timeout, TimeUnit unit) throws InterruptedException Parameters: e - It is the element to be...
2 min read
Java LinkedBlockingDeque Method The method of LinkedBlockingDeque class retrieves the head of the queue corresponding to this deque, and also removes it. This method returns null if this deque is empty. The poll(long timeout, TimeUnit unit) method of LinkedBlockingDequeclass retrieves the head of the queue...
2 min read
Java LinkedBlockingDeque Method The method of LinkedBlockingDeque class adds the defined element at the tail of this deque. Syntax: public boolean offer(E e) public boolean offer(E e, long timeout, TimeUnit unit) throws InterruptedException Parameters: e - It is the element to be added. timeout - It is the time till...
4 min read
Java LinkedBlockingDeque method The method of LinkedBlockingDeque class is used to add all the elements of the specified collection at the end of this deque. This method overrides in class AbstractQueue<E>. Syntax: public boolean addAll(Collection<? extends E> c Parameters: c- the elements to be added to this...
3 min read
Java LinkedBlockingDeque method The method of LinkedBlockingDeque class returns the first element of this deque but does not withdraw it. Syntax: public E Parameters: NA Specified By: The method of LinkedBlockingDeque class is specified by method in interface Deque<E>. Return Value: The method returns the first element of...
3 min read
Java LinkedBlockingDeque Method The method is used to check the presence of the specified element in the deque. If the element is present in the deque, then this method returns true otherwise it returns false. Syntax: public boolean contains(Object o) Parameters: o - this is the object that...
2 min read
Java LinkedBlockingDeque Method The method of LinkedBlockingDeque class retrieves the head of the queue corresponding to this deque, but doesn't remove it. The method returns null if this deque is empty. Syntax: public E Parameters: NA Specified By: The method of LinkedBlockingDeque class is specified by: method in...
3 min read
We request you to subscribe our newsletter for upcoming updates.
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