document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. /**
  2.  * HashMapContoh
  3.  * @author (etta)
  4.  * @version (24 Oktober 2020)
  5.  */
  6.  
  7. import java.util.*;
  8. class HashMapContoh
  9. {
  10.     public static void main(String args[])
  11.     {
  12.         HashMap<Integer,String> hm = new HashMap<Integer,String>();
  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. }
');