Java LinkedBlockingDeque descendingIterator() method

The descendingIterator() method of LinkedBlockingDeque class returns an iterator over the elements of this queue. The elements are returned in the reverse sequential order.

Syntax:

Parameters:

NA

Specified By:

The descendingIterator() method of LinkedBlockingDeque class is specified by descendingIterator() method of interface Deque<E>.

Return Value:

The descendingIterator() method returns an iterator across the elements of this deque in reverse order.

Example 1

Test it Now

Output:

Ramesh
Rita
Rahul
Reema

Example 2

Test it Now

Output:

Characters : 
[A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,]
After reversing the characters : 
[Z,Y,X,W,V,U,T,S,R,Q,P,O,N,M,L,K,J,I,H,G,F,E,D,C,B,A,]

Example 3

Test it Now

Output:

1..Roll No. =  17cs1029
  College =  MR University
  Name = Vineet

2..Roll No. =  15cs1010
  College =  MVN University
  Name = Geetanjali

3..Roll No. =  15cs1029
  College =  MVN University
  Name = Reema





Latest Courses