Hire QA – Specialized in QA Recruitment, Technical Interviews and Testing Solutions

What is difference between Iterator and ListIterator?

Category: Java
  • We can use Iterator to traverse Set and List collections whereas ListIterator can be used with Lists only.
  • Iterator can traverse in forward direction only whereas ListIterator can be used to traverse in both the directions.
  • 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.

Leave a Reply

Your email address will not be published. Required fields are marked *