The Java.util.concurrent.ConcurrentLinkedDeque.descendingIterator() method is used to return an iterator of the same elements as the ConcurrentLinkedDeque but in the reverse order.
Syntax:
Iterator iterate_value = Array_Deque.descendingIterator();
Parameters: The method does not take any parameter.
Return Value: The method iterates over the elements of the deque and returns the values(iterators) in reverse order.
Below programs illustrate the Java.util.concurrent.ConcurrentLinkedDeque.descendingIterator() method:
Program 1:
Output:
ConcurrentLinkedDeque: [Welcome, To, Geeks, 4, Geeks]
The iterator values are:
Geeks
4
Geeks
To
Welcome
Program 2: