Interview Question

Software Engineer Interview Beijing, Beijing (China)

Describe the difference between HashMap and HashTable

Answer

Interview Answer

1 Answer

0

HashTable is based on the old Dictionary class, and HashMap is based on Map interface since Java 1.2;
HashTable is thread safe while HashMap is not, and HashMap has better performance
HashMap allows null for a key value

Interview Candidate on Oct 3, 2011

Add Answers or Comments

To comment on this question, Sign In with Facebook or Sign Up