Which fragment puts a key/value pair in partList without the responsibility of overwriting an existing key?

Given: Which fragment puts a key/value pair in partList without the responsibility of
overwriting an existing key?

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”);



Leave a Reply 1

Your email address will not be published. Required fields are marked *


duff

duff

ConcurrentMap is abstract. Can be
ConcurrentMap partList= new ConcurrentHashMap();