import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
public class HashMapReplace {
public static void main(String[] args) {
//Creating HashMap;
Map<Integer, String> hm = new HashMap<>();
//Putting element
hm.put(1, "Naidu");
hm.put(3, "Rohilla");
hm.put(5, "Vijay");
hm.put(2, "Rahul");
hm.put(4, "Ramakesh");
hm.put(6, "Sudeep");
//Storing null value
hm.put(null, null);
hm.replace(1, "Sourav");
//as key is not present in the map, no action will be performed
hm.replace(7, "Virender");
System.out.println(hm);
}
}