Java LinkedBlockingDeque iterator() method

The iterator() method of LinkedBlockingDeque class returns an iterator across the elements of this deque in the appropriate order. The elements returned will be in the order from head to tail.

Syntax:

Parameters:

NA

Specified By:

The iterator() method of LinkedBlockingDeque class is specified by:

  • iterator() method in interface Iterable<E>.
  • iterator() method in interface Collection<E>.
  • iterator() method in interface BlockingDeque<E>.
  • iterator() method in interface Deque<E>.
  • iterator() method in class AbstractCollection<E>.

Return Value:

The iterator() method returns an iterator across the elements if this deque in the appropriate order.

Example 1

Test it Now

Output:

1.Ram
2.Sham
3.Mira
4.Rajesh

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 ,]

Example 3

Test it Now

Output:

71018
8000
1178
1190
Max number = 71018
Min number = 1178





Latest Courses