Monday, December 27, 2010

Difference between HashMap and HashTable


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

Spring Boot Config Server and Config Client.

 In Spring cloud config we can externalise our configuration files to some repository like GIT HUT, Amazon S3 etc. Benefit of externalising ...