I am new to the hash table and I will just figure out the basic operations on it. I have a hash table created as shown below and pasted values.
Hashtable<Integer , String> ht = new Hashtable<Integer , String>();
ht.put(1234, "ABCD");
ht.put(2345, "EFGH");
ht.put(4567, "IJKL");
I can delete the required item using the key, as shown below.
System.out.println("Deleting entry with key 2345");
ht.remove(2345);
System.out.println(ht.toString());
which gives the next exit
Deleting entry with key 2345
{4567=IJKL, 1234=ABCD}
I can not find any method to help find the item in the hash table, using the value as an index and deleting the item. How should I do it?
source
share