How do I retrieve LinkedList objects using ListIterator?
Category: java.util, viewed: 1K time(s).
This example show you how to use the ListIterator interface to retrieves objects from a LinkedList.
The program will prints the following output:
Grades: A
hasPrevious : true
hasNext : true
previousIndex: 0
nextIndex : 1
Grades: B
hasPrevious : true
hasNext : true
previousIndex: 1
nextIndex : 2
Grades: C
hasPrevious : true
hasNext : true
previousIndex: 2
nextIndex : 3
Grades: D
hasPrevious : true
hasNext : true
previousIndex: 3
nextIndex : 4
Grades: E
hasPrevious : true
hasNext : false
previousIndex: 4
nextIndex : 5