document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. /**
  2.  * Contoh HashMap
  3.  *
  4.  * @author Naufaliando
  5.  * @version Final
  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.              System.out.println(m.getKey()+" "+m.getValue());
  20.          }
  21.      }
  22.  }
');