Given: Which fragment puts a key/value pair in partList without the responsibility of
overwriting an existing key?
A.
partList.putAtomic(key,”Blue Shirt”)
B.
if (!partList.containsKey(key)) partList.put (key,”Blue Shirt”);
C.
partList.out(key,”Blue Shirt”);
D.
partList.putIfAbsent(key,”Blue Shirt”);
E.
partList.putIfNotLocked (key,”Blue Shirt”);
ConcurrentMap is abstract. Can be
ConcurrentMap partList= new ConcurrentHashMap();