Is there really add() method for Iterator? The api docs said under Vector... " The Iterators returned by Vector's iterator and listIterator methods are fail-fast: if the Vector is structurally modified at any time after the Iterator is created, in any way except through the Iterator's own remove or add methods, the Iterator will throw a ConcurrentModificationException. " But I found nothing add() under Iterator...
Stu Glassman
Ranch Hand
Joined: Jul 01, 2002
Posts: 91
posted
0
Vector extends the AbstractList class. AbstractList has a method named listIterator(), which returns a ListIterator. ListIterator contains those add and remove methods that you're looking for. Hope this helps, -Stu
Thomas Paul
mister krabs
Ranch Hand
Joined: May 05, 2000
Posts: 13974
posted
0
You might want to check my series on Collections in the JavaRanch newsletter.