Java – in general, when any one works, which is better, a HashMap or a hash table?

I occasionally use hash tables in several languages, but I encounter Java maps while browsing some code I checked the difference in this so question, which shows that it is very clear My question is:

>When any one can work for you, which is better? If you don't handle null values / threads, which one should you choose? > Which is more often used / more standard?

Solution

>If any of them is suitable for you, I will use HashMap because the synchronization provided by hashtable will incur overhead > I think HashMap is more standard and used more often To some extent, synchronous hashtable has been replaced by the progress of collection and concurrency framework

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
分享
二维码
< <上一篇
下一篇>>