HashMap and HashTable both are keyValue Entry they don’t guarantee the order of key value.
HashMap can store null key and Value but HashTable don’t allow null key or Value.
HashMap is not thread safe but Hash Table is thread safe.
HashTable is synchronized but HashMap is not synchronized.
HashTable is legacy class but Hash Map Is not a legacy class.
Hash Map is more efficient than Hash Table because hashmap is not synchronized so it performs faster than hashtable.
No comments:
Post a Comment