bagusistighfar86

Untitled

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