Differences between hashtable and HashMap

1. Hashtable is thread safe, synchronous and relatively inefficient.

HashMap thread is unsafe, asynchronous and relatively efficient

2. Parent class: the parent class of hashtable is dictionary and HashMap is abstractmap

3. Null: the key and value of hashtable cannot be null

At most one HashMap key is null, and the value can have multiple nulls

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>