Part V: HashMap source code analysis

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

  1. The basic global constants
  2. HashMap data structure
  3. HashMap hash function
  4. Processing of hash collision
  5. HashMap expansion mechanism
  6. Source analytic method put
  7. get analytical methods and remove the source

surroundings

Based on this code JDK1.8

The basic global constants

  1. The default initialization container size 16:
 static final int DEFAULT_INITIAL_CAPACITY = 1 << 4;  // aka 16  1 左移4位
  1. The maximum data capacity of 2 to the 30th power. That store up to 2 to the 30th power data
static 

Guess you like

Origin blog.csdn.net/u014534808/article/details/104102276
Recommended