What is the difference between fail-fast and fail-safe iterators?

Junior Java

Answer

Fail-fast: Throws ConcurrentModificationException.
Fail-safe: Works on copy; allows modification.

Want to bookmark, take notes, or join discussions?

Sign in to access all features and personalize your learning experience.

Sign In Create Account

Source: SugharaIQ

Ready to level up? Start Practice