hashmap是线程安全的吗

2025-05-20 21:33:17
推荐回答(1个)
回答1:

  ConcurrentHashMap 只是保证本身map的线程安全,不保证你自己写的程序的同步.  你可以采用客户端加锁实现同步  synchronized(test.chm)