Friday, December 16, 2011

Difference between Iterator and Listitrerator

 Iterator
  • Iterator is used to traverse Set and List and also Map type of Objects.
  • Iterator is used retrieve the elements from Collection Object in forward direction only.
Listiterator
  • List Iterator can be used to traverse for List type Objects, but not for Set type of Objects.
  • List Iterator, which allows you to traverse in two directions.
  • So it has another methods hasPrevious() & previous() other than Iterator.

No comments:

Post a Comment