Advertisement
kuchuz

PBO-C 4 : HashTable()

Nov 16th, 2020
465
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.35 KB | None | 0 0
  1. import java.util.*;
  2.  
  3. public class HashTableContoh{
  4.     public static void main (String args[]){
  5.         Hashtable<Integer,String> hm = new Hashtable<Integer,String>();
  6.         hm.put(100,"Fajar");
  7.         hm.put(102,"Satria");
  8.         hm.put(101,"Budi");
  9.         hm.put(103,"Novi");
  10.         for(Map.Entry m:hm.entrySet()){
  11.             System.out.println(m.getKey()+" "+m.getValue());
  12.         }
  13.     }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement