Java Advanced Tutorial: HashMap implementation principle

Java Advanced Tutorial: HashMap implementation principle

There was a time I did not write blog, and now even the ability to organize language has fallen ...

About HashMap

You need to know

  HashMap is that we develop the most commonly used data structures, and powerful , but to be honest, but is most strange, if not open the JDK have read his code, his study to achieve, is very unfortunate. Today we take a look at HashMap.

  Of course, if you just need an interview, remember these three can get away with:

  • HashMap thread-safe , HashTable (ancient product) is thread-safe, if you want to ensure the security thread can be used ConcurrentHashMap.
  • Internal maintain a HashMap Entry array (i.e., key-value pairs), when the space is not enough, the array will be automatically expansion of 1.5 times .
  • HashMap permitted in nulls .

HashMap

Reference material

  • To be continued

 

Guess you like

Origin www.cnblogs.com/MrSaver/p/12355088.html