集合類 | Key | Value | Super | 說明 |
---|---|---|---|---|
Hashtable | 不允許爲 null | 不允許爲 null | Dictionary | 線程安全 |
ConcurrentHashMap | 不允許爲 null | 不允許爲 null | AbstractMap | 分段鎖技術 |
TreeMap | 不允許爲 null | 允許爲 null | AbstractMap | 線程不安全 |
HashMap | 允許爲 null | 允許爲 null | AbstractMap | 線程不安全 |
參考:阿里巴巴 Java 開發手冊
集合類 | Key | Value | Super | 說明 |
---|---|---|---|---|
Hashtable | 不允許爲 null | 不允許爲 null | Dictionary | 線程安全 |
ConcurrentHashMap | 不允許爲 null | 不允許爲 null | AbstractMap | 分段鎖技術 |
TreeMap | 不允許爲 null | 允許爲 null | AbstractMap | 線程不安全 |
HashMap | 允許爲 null | 允許爲 null | AbstractMap | 線程不安全 |
參考:阿里巴巴 Java 開發手冊