Java Deque descendingIterator() Method

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

Test it Now

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

Test it Now

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




Latest Courses