Implementation of the hash function in a HashMap
-
Hi,
I was wondering if anyone knew whether the implementation of thehash function in a hash map is the same as in a hash table, i.e. are
the same implementation options available for a hash map?
Also, I wonder why Hash tables were deprecated in Java 5 other than
having multiple locks in the ConcurrentHashMap class and whether
ConcurrentHashMap implements the same hash functions as a Hash Table.
This is likely a question for Oracle or Microsoft or for someone who has worked there. If anyone knows, please share.
Thanks,
Saad
-
Hi,
I was wondering if anyone knew whether the implementation of thehash function in a hash map is the same as in a hash table, i.e. are
the same implementation options available for a hash map?
Also, I wonder why Hash tables were deprecated in Java 5 other than
having multiple locks in the ConcurrentHashMap class and whether
ConcurrentHashMap implements the same hash functions as a Hash Table.
This is likely a question for Oracle or Microsoft or for someone who has worked there. If anyone knows, please share.
Thanks,
Saad
The hash function should be identical for a hash table and a hash map; in both cases you go from a key to a table index.