What is difference between for loop and iterator?

Difference between the two traversals In for-each loop, we can’t modify collection, it will throw a ConcurrentModificationException on the other hand with iterator we can modify collection . Modifying a collection simply means removing an element or changing content of an item stored in the collection.

Sizin İçin Seçtik  What is a loop iteration quizlet?

Leave a Reply

Your email address will not be published. Required fields are marked *