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