Advertisement
ListIterator | Iterator |
---|---|
ListIterator works only in the collection classes that has implemented List interface such as ArrayList, LinkedList etc. | Iterator can be used to cycle over elements of any collection class such as ArrayList, LinkedHashSet, PriorityQueue etc |
ListIterator allows a bidirectional access of a list, i.e. accessing a list in the forward or backward direction | Iterator only allows a forward access of a collection. |
ListIterator also provide support to modify the elements while iterating them. | Iterator does not allow modification of elements while iterating them. |
ListIterator allows us to add new elements to the list. | Iterator does not allow us to add new elements to a collection. |
ListIterator extends Iterator and hence it is a subclass of Iterator. | Iterator is a superclass of ListIterator. |
Advertisement
Advertisement
Please check our latest addition
C#, PYTHON and DJANGO
Advertisement