Is HashMap thread safe? Why is it not thread safe

1.HashMap is not thread safe.
2. It will happen when put or resize, the data operated by the latter thread will overwrite the data operated by the previous thread, or the data will be lost.

 

The explanation comes from here: https://www.cnblogs.com/FirstClass/p/6501290.html

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325193995&siteId=291194637