Java

Difference between Enumeration vs Iterator vs ListIterator

Enumeration, Iterator and ListIterator are three types of cursor interfaces present java.util package as part of collection framework through which we can traverse over the elements of collection object. Though they perform the same function i.e for getting successive elements from underlying collection object, but there are some differences exist between them. Difference between Enumeration and Iterator and ListIterator   Property …

Difference between Enumeration vs Iterator vs ListIteratorRead More »

ListIterator Interface In Collection Framework

ListIterator is most powerful cursor available in Java collection API. By using ListIterator we can move either to the forward direction or to the backward direction and hence ListIterator is bidirectional cursor, unlike Enumeration or Iterator cursor which are single direction cursor. By using ListIterator we can perform both replacement & addition of new elements in underlying …

ListIterator Interface In Collection FrameworkRead More »

Enumeration Interface In Collection Framework

If we want to retrieve objects one by one from the collection, then we should go for cursors. There are three types of cursors available in Java collection framework in the form of Interface having different capabilities : Enumeration Interface Iterator Interface ListIterator Interface We can use Enumeration to get objects one by one from the old legacy …

Enumeration Interface In Collection FrameworkRead More »