Hello,
I have a class which uses HashMap internally to store its data. I have 3 methods in the class - add(), get() and exists(). If this class were to be accessed from a multi-threading environment, should I synchronize all 3 methods?
I have a class which uses HashMap internally to store its data. I have 3 methods in the class - add(), get() and exists(). If this class were to be accessed from a multi-threading environment, should I synchronize all 3 methods?