document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. /**
  2.  * Hash Map
  3.  *
  4.  * @author Migel Aulia Mandiri Putra
  5.  * @version 24 Oktober 2020
  6.  */
  7. import java.util.*;
  8. class HashMapContoh{
  9.     public static void main(String args[])
  10.     {
  11.         HashMap <Integer,String> hm=new HashMap <Integer,String>();
  12.        
  13.         hm.put(100,"Kano");
  14.         hm.put(101,"Laila");
  15.         hm.put(102,"Badu");
  16.         hm.put(null, "Johan");
  17.        
  18.         for(Map.Entry m:hm.entrySet())
  19.         {
  20.             System.out.println(m.getKey()+" "+m.getValue());
  21.         }
  22.     }
  23.  }
');