Java LinkedTransferQueue iterator() method

The iterator() method of LinkedTransferQueue class is used to return an iterator over the elements in this queue in proper sequence.

Syntax:

Specified By:

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

  • iterator in interface Iterable<E>
  • iterator in interface Collection<E>
  • iterator in class AbstractCollection<E>

Return:

This method returns an iterator over the elements in this queue in proper sequence

Example 1

Test it Now

Output:

1.Jackson
2.Harry
3.John
4.Honey

Example 2

Test it Now

Output:

1.1.Roll No. =  15cs1029
  College =  AKTU University
  Name = Harry

2.2.Roll No. =  15cs1010
  College =  CCS University
  Name = Johnson

3.3.Roll No. =  17cs1029
  College =  MR University
  Name = Marry

4.4.Roll No. =  15cs1011
  College =  MVN University
  Name = Jack

Example 3

Test it Now

Output:

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





Latest Courses