Advertisement
LoganBlackisle

HashTable

Jun 18th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. package prep_31_hashing;
  2.  
  3. import java.util.Hashtable;
  4.  
  5. public class HashTable {
  6. public static void main(String args[]) {
  7.  
  8. // Create a HashTable to store
  9. // String values corresponding to integer keys
  10. Hashtable<Integer, String>
  11. hm = new Hashtable<Integer, String>();
  12.  
  13. // Input the values
  14. hm.put(1, "Geeks");
  15. hm.put(12, "forGeeks");
  16. hm.put(15, "A computer");
  17. hm.put(3, "Portal");
  18.  
  19. // Printing the Hashtable
  20. System.out.println(hm);
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement