import java.util.*; public class HashTableExample { public static void main(String args[]) { // Create a hash map Hashtable ht = new Hashtable(); Enumeration htenum; String str; double bal; ht.put("Neha", new Double(3434.34)); ht.put("Ankit", new Double(123.22)); ht.put("Rohit", new Double(1378.00)); ht.put("Vinay", new Double(99.22)); ht.put("Vijay", new Double(-19.08)); // Show all balances in hash table. htenum = ht.keys(); while (htenum.hasMoreElements()) { str = (String) htenum.nextElement(); System.out.println(str + ": " + ht.get(str)); } System.out.println(); // Deposit 1,000 into Neha's account bal = ((Double) ht.get("Neha")).doubleValue(); ht.put("Neha", new Double(bal + 1000)); System.out.println("Neha's new balance: " + ht.get("Neha")); } }