java_集合學習(一)

Java
HashMap
⼀、概述
在官⽅⽂檔中是這樣描述HashMap的:
Hash table based implementation of the Map interface. This implementation provides
all of the optional map operations, and permits null values and the null key. (The
HashMap class is roughly equivalent to Hashtable, except that it is unsynchronized
and permits nulls.) This class makes no guarantees as to the order of the map; in
particular, it does not guarantee that the order will remain constant over time.
⼏個關鍵的信息:基於Map接⼝實現、允許null鍵/值、⾮同步、不保證有序(⽐如插⼊的順序)、
也不保證序不隨時間變化。
在HashMap中有兩個很重要的參數,容量(Capacity)和負載因⼦(Load factor)
Initial capacity: The capacity is the number of buckets in the hash table, The initial
capacity is simply the capacity at the time the hash table is created.
Load factor: The load factor is a measure

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章