In Java,
use the same logic of the following code:
import java.io.*; import java.util.*; class HashBasicsCW { public static void main(String args[]) { Hashtable<Integer, String> ht = new Hashtable<>(); // using put() method to insert ht.put(1, "Worcester"); ht.put(2, "State"); ht.put(3, "University"); // Print mappings System.out.println("Mappings of ht : " + ht); } }