Pergunta de entrevista da empresa Siemens

what is difference between hash map and hash table?

Respostas da entrevista

Sigiloso

1 de abr. de 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

Sigiloso

18 de mar. de 2010

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