Concurrency with ConcurrentHashMap and synchronized methods
800306Oct 22 2007 — edited Oct 22 2007Hi,
I have a class with a private constructor that provides static methods, which add things to or remove things from a Map, which I implement as a ConcurrentHashMap. I want this class to be completely thread-safe.
Is it satisfactory to use a static ConcurrentHashMap with static methods in the class, or do I also need to declare the methods to be synchronized? If so, why?
Thanks,
Dan