Question about java concurrenthashmap replace method
-
07-11-2019 - |
题
I have the following code
public class Test{
private static final String key = "key";
public static void main(String[] a){
ConcurrentHashMap<String,String > map = new ConcurrentHashMap<String,String>();
System.out.println(map.replace(key,"1"));
System.out.println(map.replace(key,"2"));
}
}
The output is null both times. Isn't it supposed to be 1 second time?
没有正确的解决方案
不隶属于 StackOverflow