1.

Difference Between Iterator And Listiterator?

Answer»

There are three Differences are there:

  • We can use Iterator to traverse Set and List and ALSO Map type of Objects. But List Iterator can be used to traverse for List type Objects, but not for Set type of Objects.
  • By using Iterator we can retrieve the elements from Collection Object in forward direction only WHEREAS List Iterator, which ALLOWS you to traverse in either directions using hasPrevious() and previous() methods.
  • ListIterator allows you MODIFY the list using add() REMOVE() methods. Using Iterator you can not add, only remove the elements.

There are three Differences are there:



Discussion

No Comment Found