Sollicitatievraag bij Siemens

what is difference between hash map and hash table?

Antwoorden op sollicitatievragen

Anoniem

1 apr 2016

1. Hashmap is non synchronized while Hashtable is, which is saying Hashtable is multi-thread safe while Hashmap is not. If your application only has one thread. The you should use Hashmap . 2. Hashmap allows one null key and null values while Hashtable allow no null keys either null values. 3.Hashmap objects interate values by iterator while Hashtable use enumerator. 4. Hashmap is faster than Hashtable 5. Not sure about superclass and legency part

Anoniem

18 mrt 2010

Hash map can accept null values where as hash table does not accept the null values.