by Dinesh Thakur

 

   import java.util.*;

class JavaExampleHashMap
 {
    public static void main(String as[])
    {
        HashMap Hshmp = new HashMap();
        Hshmp.put("Item One","Value One");
        Hshmp.put("Item Two","Value Two");
        Hshmp.put("Item Three","Value Three");
        Hshmp.put("Item Four","Value Four");
        Hshmp.put("Item Five","Value Five");
        Hshmp.put("Item Six","Value Six");
        Hshmp.put("Item Seven","Value Seven");
        Set st = Hshmp.entrySet();
        Iterator Itrtr = st.iterator();
        while(Itrtr.hasNext())
             {
                 Map.Entry Mpentry = (Map.Entry) Itrtr.next();
                 System.out.println(Mpentry.getKey() + "/" + Mpentry.getValue());
             }
    }
 }

HashMap Java Example