Sollicitatievraag bij Deloitte

What is the difference between HashMap and HashTable?

Antwoord op sollicitatievraag

Anoniem

7 jun 2017

1. HashMap is not-synchronized while HashTable is synchronized 2. Hashmap is fast and HashTable is slow because it is synchronized 3. Hashmap is traversed through Iterator while hashTable through enumerator 4. HashMap is fail-fast while HashTable is fail-safe(weakly consistent) 5. hashMap can have one null key while hashTable cannot have null key