Skip to content
Sharp

Collections · interview question

Which Traversal method is safest for removing elements from a Collection while iterating?

Multiple choiceMediumchapter-4-curatedpremiumcollectionsiteration-and-traversal
Choose one answer
Answer and explanation

Correct answer

A. Using Iterator with remove()

Why

Using an Iterator with the remove() method is safe for removing elements during iteration, as it avoids ConcurrentModificationException.

Test yourself on Collections

A free test with instant, explained results. No account needed.

Start free test
All Collections questions →