我读了一篇 Oracle 教程,其中提到哈希表不再同步。从何时起? http://docs.oracle.com/javase/tutorial/collections/implementations/index.html 表后第三段。
最佳答案
不,Hashtable
仍然是同步的。您所指的段落甚至明确地说:
The legacy collections Vector and Hashtable are synchronized.
(前一句:
[...] The fact that these implementations are unsynchronized [...]
指的是表中不包括HashTable
的集合。)
关于java - java hashTable 在版本 7 中是否仍然同步?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9153785/