Difference between Iterator and ListIterator

site de rencontres seniors sérieux 1) Iterator is used for traversing List and Set both.

manhunt anual oficial online dating We can use ListIterator to traverse List only, we cannot traverse Set using ListIterator.

rencontre celibataire dans le gard 2) We can traverse in only forward direction using Iterator.

http://www.laderaranchdentistry.com/bistrota/1580 Using ListIterator, we can traverse a List in both the directions (forward and Backward).

http://hongrie-gourmande.com/frensis/1997 3) We cannot obtain indexes while using Iterator

rencontres en alsace We can obtain indexes at any point of time while traversing a list using ListIterator. The methods nextIndex() and previousIndex() are used for this purpose.

go to link 4) We cannot add element to collection while traversing it using Iterator, it throws ConcurrentModificationException when you try to do it.

karachi dating points exposed by ary news We can add element at any point of time while traversing a list using ListIterator.

source url 5) We cannot replace the existing element value when using Iterator.

By using set(E e) method of ListIterator we can replace the last element returned by next() or previous() methods.

site de rencontre femme entre femme Methods of Iterator:

  • hasNext()

indian dating apps for iphone Methods of ListIterator:

  • add(E e)
    set(E e)