For addition of elements to Map, use put() method. This process is explained by the given code.
Key values are mapped by calling 3 put() methods, in the code given above. Both values & keys are String, in above code. To get value, use this code.
Java Code: This is the code to explain map add operation
Map mapA = new HashMap();
mapA.put("key1", "element 1");
mapA.put("key2", "element 2");
mapA.put("key3", "element 3");
Java Code: This is the code to explain map access operation