InterviewSolution
Saved Bookmarks
| 1. |
Iterator vs ListIterator in Java |
||||||||||||
|
Answer» Both ITERATOR and ListIterator in Java are an interface in the Collection framework. The Iterator is used to traverse the Collection elements by iterating each element individually in the forward direction. ListIterator extends the Iterator and is used to traverse the Collection elements in both forward and BACKWARD directions. Also, elements can be added, modified and removed in the Collection using ListIterator which is not possible using Iterator. The differences between Iterator and ListIterator are given as FOLLOWS:
|
|||||||||||||