Today we went to learn HashMap source code, the same data structure and data structure ConcurrentHashMap of HashMap, so later learning to learn HashMap ConcurrentHashMap helpful.
table of Contents
- The basic global constants
- HashMap data structure
- HashMap hash function
- Processing of hash collision
- HashMap expansion mechanism
- Source analytic method put
- get analytical methods and remove the source
surroundings
Based on this code JDK1.8
The basic global constants
- The default initialization container size 16:
static final int DEFAULT_INITIAL_CAPACITY = 1 << 4; // aka 16 1 左移4位
- The maximum data capacity of 2 to the 30th power. That store up to 2 to the 30th power data
static