Friday, 4 September 2015

Collection : Difference between HashMap and HashTable in Java ?

ParameterHashmapHashtable
SynchronizedNot SyncronizedSyncronized
Null key and ValueAllows one null key and any number of null valuesNot allow null keys or values
Fail fastIterator in Hashmap is fail fastEnumeration in Hashtable is not fail fast
ThreadSafeNoYes
ExtendsExtends AbstractMap classExtends Dictionary class
PerformanceFaster then HashtableSlower then Hashmap

No comments:

Post a Comment