Everyone might have used HashMap and HashTable.....have you ever thought howz it handling the keys and values inside...? Even i havnt thought about it....:)
HashTable hashTable_Emp = new HashTable();
hashTable_Emp.put("E1","empName");
It transforms your key to a index value using hash function which enables it for a faster searching mechanism...
To know about hash function----> en.wikipedia.org/wiki/Hash_function
And don forget to hav a look over the hashCode() method under Object class...
http://www.cafeaulait.org/course/week4/38.html
No comments:
Post a Comment