Difference Between Iterator and ListIterator in Java

JavaServer Side ProgrammingProgramming

In this post, we will understand the difference between Iterator and ListIterator.


  • It helps traverse through a map, list and a set.

  • Index can’t be obtained with the help of an iterator.

  • The iterator can’t modify or replace elements of a Collection.

  • It traverses through elements present in Collection.

  • This iteration can be done in the forward direction only.

  • Elements can’t be added, since it would throw ConcurrentModificationException.

  • Methods of the iterator are ‘next()’, ‘remove()’, ‘hasNext()’.


  • It helps traverse through a list only.

  • It can’t traverse through a map and a set.

  • It can traverse through the elements present in Collection.

  • The traversal can be done in both forward and backward directions.

  • Some of the methods of listiterator are ‘nextIndex()’, ‘previousIndex()’, ‘previous()’, ‘next()’.

  • The elements can be modified or replaced.

  • Elements can be added to a collection anytime.

Updated on 24-Mar-2021 12:32:15