Java Deque descendingIterator() Method

22 Mar 2025 | 2 min read

The descendingIterator() method of Java Deque Interface returns an iterator for the elements in the specified deque in a reverse sequence. The elements will return in a sequential order from first(head) to the last(tail).

Syntax:

Parameter:

NA

Return:

The above method returns an iterator for the elements in the specified deque in a reverse sequence.

Example 1

Output:

 The list of numbers before using descendingIterator : 32 21 20 17 89 The list of numbers after using descendingIterator : 89 17 20 21 32 

Example 2

Output:

 The list of numbers before using descendingIterator : 20.0 11.0 66.0 89.0 77.0 The list of numbers after using descendingIterator : 77.0 89.0 66.0 11.0 20.0 
Next TopicJava Deque