change the value in a hashtable java

Java
map.replace(key, newValue);
Source

Also in Java: