Session - 69 (Iterator, ListIterator and Enumeration cursors in java collection)

Опубликовано: 06 Май 2026
на канале: Cubicles Software Testing
321
10

In this video, you can understand:
Cursor
1. Iterator
We can retrieve the data from the collection by using the iterator method
Iterator it = al.iterator();
a. hasNext()
b. next()
c. remove()
we can retrieve, and remove the objects by using the iterator cursor
It works only in the forward direction

2. ListIterator
We can retrieve the data from List type collection by using listIterator method
ListIterator li = al.listIterator();
a. hasNext()
b. next()
c. remove()
d. hasPrevious()
e. previous()
f. set()
g. add()
It works in both forward and reverse direction

3. Enumeration
We can retrieve the data from Vector, Stack type collection by using elements() method
JDK 1.0 [Legacy Class]
a. hasNextElements()
b. nextElement()