VOOZH about

URL: https://www.geeksforgeeks.org/java/concurrentlinkeddeque-descendingiterator-method-in-java-with-example/

⇱ ConcurrentLinkedDeque descendingIterator() method in Java with Example - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

ConcurrentLinkedDeque descendingIterator() method in Java with Example

Last Updated : 24 Dec, 2018
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:
Output:
ConcurrentLinkedDeque: [10, 15, 30, 20, 5]
The iterator values are: 
5
20
30
15
10
Comment