1.

Is Hashmap Thread-safe In Java?

Answer»

No, HashMap is not THREAD-safe in Java. You should not share an HashMap with MULTIPLE threads if one or more thread is MODIFYING the HashMap e.g. inserting or removing a MAP. Though, you can easily share a read-only HashMap.

No, HashMap is not thread-safe in Java. You should not share an HashMap with multiple threads if one or more thread is modifying the HashMap e.g. inserting or removing a map. Though, you can easily share a read-only HashMap.



Discussion

No Comment Found