collection framework

Enumeration VS Iterator in Java

It’s very important to understand the fundamental of both the interface for interview point of view or for work assignment aspect. Where should you use which interface? you can say most of the time you get encountered this question in interview which one should be used where?

fail-fast iterator vs fail-safe iterator in Java

When I first encounter with these terminology, some questions arise in my mind about fail-fast and fail-safe , in initial days. When we add anything while iterating we encounter ConcurrentModificationException, specially , when we delete element from collection while iterating using for-each loop of jdk 5. I hope every developer in their life must encounter …

fail-fast iterator vs fail-safe iterator in Java Read More »