HashMap is a Map based collection class that is used for storingKey & value pairs, it is denoted as HashMapor HashMap. This class makes no guarantees as to theorder of the map. It is similar to the Hashtable class except thatit is unsynchronized and permits nulls(null values and nullkey).
5.Write a Java program to test if a map contains a mapping forthe specified key.a.Add values in the Hash mapb.Printthe mapc.Checkfor a specified key, print result
6.Write a Java program to copy all of the mappings from thespecified map to another map. Use iterator with both for each andwhileloop,print out the key with the matching value.
You can combine them into one single program.