1.

Why Iterator Doesn't Have Add Method Whereas Listiterator Has Add Method?

Answer»

Iterator can be OBTAINED on any Collection CLASS like List or SET so contract for Iterator makes no guarantees about the order of ITERATION

But ListIterator can only be used to traverse a List so it does guarantee the order of the iteration. That is why ListIterator provides an ADD operation.

Iterator can be obtained on any Collection class like List or Set so contract for Iterator makes no guarantees about the order of iteration. 

But ListIterator can only be used to traverse a List so it does guarantee the order of the iteration. That is why ListIterator provides an add operation.



Discussion

No Comment Found