Here is the sample how to implement Mymap in Java programming
public class Exercise {
public static void main(String[] args) {
// Create a map
MyMap<String, Integer> map = new MyHashMap<>();
map.put("Sebastian", 35);
map.put("Andre", 37);
map.put("Luke", 25);
map.put("Caroline", 25);
map.put("Thomas", 23);
map.put("Makaela", 23);
map.put("Shayne", 56);
map.put("Will", 24);
System.out.println("Entries in map: " + map);
System.out.println("The age of Luke is " +
map.get("Luke"));
System.out.println("The age of Will is " +
map.get("Will"));
System.out.println("Is Shayne in the map? " +
map.containsKey("Shayne"));
System.out.println("Is Jack in the map? " +
map.containsKey("Jack"));
System.out.println("Is age 37 in the map? " +
map.containsValue(37));
System.out.println("Is age 35 in the map? " +
map.containsValue(35));
System.out.print("Keys in map: ");
for (String key : map.keySet()) {
System.out.print(key + " ");
}
System.out.println();
System.out.print("Values in map: ");
for (int value : map.values()) {
System.out.print(value + " ");
}
System.out.println();
map.remove("Shayne");
System.out.println("Entries in map " + map);
map.clear();
System.out.println("Entries in map " + map);
}
}
Learn more about Java Programming here:
https://brainly.com/question/12972062
#SPJ4