What is the difference b/w Iterator & ListIterator

Iterator : Enables you to cycle through a collection,obtaining or removing elements

ListIterator :It extends Iterator allow bidirectional traversal of list & the modification of element

Showing Answers 1 - 8 of 8 Answers

suresh

  • Jan 25th, 2006
 

in iterator forword traversing only possible but in list iterator both type of traversing is possible

sbarik

  • Jan 30th, 2006
 

Iterator :--- Iterator takes the place of Enumeration in the Java collections framework. One can traverse throughr the the collection with the help of iterator in forward direction only and Iterators allow the caller to remove elements from the underlying collection during the iteration with well-defined semantics

ListIterator:--An iterator for lists that allows one to traverse the list in either direction.modify the list during iteration, and obtain the iterator's current position in the list. A ListIterator has no current element. its cursor position always lies between the element that would be returned by a call to previous() and the element that would be returned by a call to next(). In a list of length n, there are n+1 valid index values, from 0 to n, inclusive.

sampra

  • Mar 13th, 2012
 

Iterator : Enables you to cycle through a collection,obtaining or removing elements

ListIterator :It extends Iterator allow bidirectional traversal of list & the modification of element

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions