1) 1)add items in the map.2)remove items from int value = map.get("cherry");
the map.3)search specifickey fromthe map4)get value of the specific key 5)insert map System.out.println("The value of the key elementsofthe map in to other map 6)print all 'cherry' is " + value); keys and values of the map injav injavapackage hashSet; System.out.println(" "); import java.util.HashMap; System.out.println("inset map element of import java.util.Map; one map into other map ."); public class MapExample { Map<String, Integer> map2 = new HashMap<>(); public static void main(String[] args) { map2.put("orange", 4); Map<String, Integer> map = new HashMap<>();System.out.println("add items in map2.put("pear", 5); the map."); map.putAll(map2); map.put("apple", 1); System.out.println(map2); map.put("banana", 2); System.out.println(" "); map.put("cherry", 3); System.out.println("print all keys and System.out.println(map); values of the map"); System.out.println(" "); for (Map.Entry<String, Integer> entry : map.entrySet()) { System.out.println("remove items in the map."); System.out.println("Key: " + entry.getKey() + ", Value: " + map.remove("banana"); entry.getValue()); }}} System.out.println(map); Output: System.out.println(" ");