Question: Map has its implementation in various classes like HashMap. Following is an example to explain map functionality: import java.util.*; public class CollectionsDemo { public static
Map has its implementation in various classes like HashMap. Following is an example to explain map functionality:
import java.util.*; public class CollectionsDemo {
public static void main(String[] args) { Map m1 = new HashMap(); m1.put("Zara", "8"); m1.put("Mahnaz", "31"); m1.put("Ayan", "12"); m1.put("Daisy", "14");
System.out.println(); System.out.println(" Map Elements"); System.out.print("\t" + m1); } }
Implement atleast 6 methods (in Java) from the below table (screenshot) by using the given code and write down the output. Methods are described in screenshot.

Method Summary void clear () Removes all of the mappings from this map (optional operation) Returns true if this map contains a mapping for the specified key Returns true if this map maps one or more keys to the speci boolean containsKey (Object key boolean containsvalue (Object value) fied value entrySet () SetcMap Entry
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
