package devmanuals.com; import java.util.Map; import java.util.HashMap; public class MapGet { public static void main(String args[]){ Map mp =new HashMap(); mp.put(1, "A"); mp.put(2, "B"); mp.put(3, "C"); mp.put(4, "D"); mp.put(5, null); System.out.println("Mappings are : "+mp); boolean bol=mp.containsKey(4); System.out.println("does the key 4 mappings into this map : "+bol); System.out.println("Value of the key '4' is : "+mp.get(4)); bol=mp.containsKey(5); System.out.println("does the key 5 mappings into this map : "+bol); System.out.println("Value of the key '5' is : "+mp.get(5)); bol=mp.containsKey(6); System.out.println("does the key 6 mappings into this map : "+bol); System.out.println("Value of the key 6 is : "+mp.get(6)); } }