Java集合-HashMap
Java的HashMap是一种基于哈希表实现的数据结构,用于存储键值对。在HashMap中,每个键都映射到一个值。
HashMap源码分析
成员变量
static final int DEFAULT_INITIAL_CAPACITY = 1 << 4; // aka 16
/**
* The maximum capacity, used if a higher value is implicitly specified
* by either of the constructors with arguments.
* MUST be a power of two <= 1<<30.
*/
static final int MAXIMUM_CAPACITY = 1 << 30;
/**
* The load factor used when none specified in constructor.
*/
static final float DEFAULT_LOAD_FACTOR = 0.75f;
大约 18 分钟