1. We can use Iterator to traverse Set and List collections whereas ListIterator can be used with Lists only.
2.
Iterator can traverse in forward direction only whereas
ListIterator can be used to traverse in both the directions.
3.
ListIterator inherits from Iterator interface and comes with
extra functionalities like adding an element, replacing an element, getting
index position for previous and next elements.
No comments:
Post a Comment