how to change value of a key in hashmap in java code example Example: java hashmap set value myMap.put(key, value);