![](/img/trans.png)
[英]Efficiency of HashTable and Collections.synchronized(HashMap)
[英]Why Hashmap is not synchronized, where internally Hashmap implements Hashtable(which is synchronized).
為什么即使Hashmap在內部實現了同步的Hashtable,也無法同步Hashmap。
Hashmap不實現(或擴展為更精確)Hashtable。 它實現了Map,這是一個接口,並且沒有說明同步策略:
public class HashMap<K,V>
extends AbstractMap<K,V>
implements Map<K,V>, Cloneable, Serializable
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.