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


● Fail-fast (like in ArrayList, HashMap) throw ConcurrentModificationException if the collection is modified while iterating.
● Fail-safe (like in CopyOnWriteArrayList, ConcurrentHashMap) operate on a clone, so no exception is thrown.

🔹 2. Why does HashMap key need equals() and...