import java.util.*; public class MapExample { public static void main(String[] args) { MapThis code creates a HashMap, adds three entries to it, retrieves and updates an entry, removes an entry, and iterates over the remaining entries to print their values. The Map interface is part of the java.util package, which is part of the Java standard library.map = new HashMap<>(); // Insert entries into the Map map.put("John", 24); map.put("Emily", 28); map.put("Tom", 19); // Access entries in the Map System.out.println("Age of John: " + map.get("John")); System.out.println("Age of Emily: " + map.get("Emily")); // Update entry in the Map map.put("John", 25); System.out.println("Updated age of John: " + map.get("John")); // Remove entry from the Map map.remove("Tom"); System.out.println("Entry for Tom removed"); // iterate over the entries in the map for (Map.Entry entry : map.entrySet()) { System.out.println("Name: " + entry.getKey() + ", Age: " + entry.getValue()); } } }