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?

没有正确的解决方案

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top