Hashtable is synchronized, in contrast to HashMap. This gives us the reason that HashMap should be used if it is thread-safe, since Hashtable has overhead for synchronization. 2. HashMap If key of the HashMap is self-defined objects, then equals() and hashCode() contract need to be f...
It is synchronized. It is a legacy class. public class Hashtable<K,V> extends Dictionary<K,V> implements Map<K,V>, Cloneable, Serializable Ref: http://javarevisited.blogspot.in/2015/08/difference-between-HashMap-vs-TreeMap-vs-LinkedHashMap-Java.html Share Improve this answer Follow edited...
None of these implementation are synchronized. That is if multiple threads access a set concurrently, and at least one of the threads modifies the set, it must be synchronized externally. LinkedHashSetis in some sense intermediate betweenHashSetandTreeSet. Implemented as a hash table with a link...