Timo_

HashTableContoh

Oct 26th, 2020
475
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.50 KB | None | 0 0
  1. /**
  2.  * @author Timotius Wirawan
  3.  * @version 27 oktober 2020
  4.  */
  5.  
  6. import java.util.*;
  7. class HashTableContoh
  8. {
  9.     public static void main(String args[])
  10.     {
  11.         Hashtable<Integer,String> hm=new Hashtable<Integer,String>();
  12.        
  13.         hm.put(100,"Andri");
  14.         hm.put(102,"Roni");
  15.         hm.put(101,"Fahrul");
  16.         hm.put(103,"Badu");
  17.        
  18.         for(Map.Entry m:hm.entrySet())
  19.         {
  20.             System.out.println(m.getKey()+" "+m.getValue());
  21.         }
  22.     }
  23. }
Add Comment
Please, Sign In to add comment