![]() |
VOOZH | about |
The descendingIterator() method of the Deque Interfacereturns an iterator over the elements in this deque in reverse order. The elements will be returned from the last to the first order. This can be used with any class implementing the Deque Interface like LinkedList, ArrayDeque, LinkedBlockingDeque, etc.
Syntax:
Iterator descendingIterator()Example 1: Here, we are using the LinkedList as Deque.
4 3 2 1
Example 2: Here, we are using the ArrayDeque as Deque.
You How Are Geeks Hello