Online Java Compiler By
JavaTpoint.com
import java.util.*; public class CollectionsCheckedMapExample2 { public static void main(String[] args) { Map
map = new HashMap
(); map.put(1, "One"); map.put(2, "Two"); map.put(3, "Three"); System.out.println("Map Element: "+map); Map map2 = map; map2.put("Four", 4); System.out.println(map2); } }
Output