前言

本文基于版本 JDK 1.8,即 Java 8关于版本 JDK 1.7,即 Java 7,具体请看文章Java:手把手带你源码分析 HashMap 1.7

目录

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/8c1edf35-14c8-4d5b-a8e4-09c55ab5e83d/aHR0cHM6Ly9pbWdjb252ZXJ0LmNzZG5pbWcuY24vYUhSMGNITTZMeTlwYldkamIyNTJaWEowTG1OelpHNXBiV2N1WTI0dllVaFNNR05FYjNaTU0xWjNZa2M1YUZwRE1YQmlWMFp1V2xoTmRXRnRiR2hpYms1dlpGTTFjR0o1T1RGalIzaDJXVmRTWm1GWE1XaGFNbFo2VEhwck1FNUVUVEpPVXpBeFRYcGpkMDFFV21oYWFsa3pXVlJaZVU1NlZUVk1ia0oxV25vNWNHSlhSbTVhVlRGMldqTkplVXd5UmpGa1J6aDBZak5LY0ZwWE5UQk1NMDR3WTIxc2QwcFVaRVJoVnpGb1dqSldWMkZYVmpOTmFUaDVURE5qZGsxVVNUQk5RUQ

1. 简介

public class HashMap<K,V>
         extends AbstractMap<K,V>
         implements Map<K,V>, Cloneable, Serializable

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/da2d1a22-096a-42d9-b79b-b1e006c7d292/aHR0cHM6Ly9pbWdjb252ZXJ0LmNzZG5pbWcuY24vYUhSMGNITTZMeTlwYldkamIyNTJaWEowTG1OelpHNXBiV2N1WTI0dllVaFNNR05FYjNaTU0xWjNZa2M1YUZwRE1YQmlWMFp1V2xoTmRXRnRiR2hpYms1dlpGTTFjR0o1T1RGalIzaDJXVmRTWm1GWE1XaGFNbFo2VEhwck1FNUVUVEpPVXpCM1QwUmFhVTVVYUdoYVYxWnNUVzFSZDAxSFRtbE1ia0oxV25vNWNHSlhSbTVhVlRGMldqTkplVXd5UmpGa1J6aDBZak5LY0ZwWE5UQk1NMDR3WTIxc2QwcFVaRVJoVnpGb1dqSldWMkZYVmpOTmFUaDVURE5qZGsxVVNUQk5RUQ

请务必打开JDK 1.7对照看:Java:手把手带你源码分析 HashMap 1.7

2. 数据结构:引入了 红黑树

2.1 主要介绍

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/6d0b4c09-501f-4021-b9f4-46fb7c390d2b/aHR0cHM6Ly9pbWdjb252ZXJ0LmNzZG5pbWcuY24vYUhSMGNITTZMeTlwYldkamIyNTJaWEowTG1OelpHNXBiV2N1WTI0dllVaFNNR05FYjNaTU0xWjNZa2M1YUZwRE1YQmlWMFp1V2xoTmRXRnRiR2hpYms1dlpGTTFjR0o1T1RGalIzaDJXVmRTWm1GWE1XaGFNbFo2VEhwck1FNUVUVEpPVXpBMVQwUkZNMDlFWTNkT2VtY3hUbFJaTTA0eVNtcE1iWEIzV25vNWNHSlhSbTVhVlRGMldqTkplVXd5UmpGa1J6aDBZak5LY0ZwWE5UQk1NMDR3WTIxc2QwcFVaRVJoVnpGb1dqSldWMkZYVmpOTmFUaDVURE5qZGsxVVNUQk5RUQ

关于 红黑树 了解:http://blog.csdn.net/v_july_v/article/details/6105630

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/81746bd0-883f-4f5a-97a3-9221355ab6ec/aHR0cHM6Ly9pbWdjb252ZXJ0LmNzZG5pbWcuY24vYUhSMGNITTZMeTlwYldkamIyNTJaWEowTG1OelpHNXBiV2N1WTI0dllVaFNNR05FYjNaTU0xWjNZa2M1YUZwRE1YQmlWMFp1V2xoTmRXRnRiR2hpYms1dlpGTTFjR0o1T1RGalIzaDJXVmRTWm1GWE1XaGFNbFo2VEhwck1FNUVUVEpPVXpGcldYcG9hVTF0U1RKWlYxVjVUbXBzYlZwdFZteE1ia0oxV25vNWNHSlhSbTVhVlRGMldqTkplVXd5UmpGa1J6aDBZak5LY0ZwWE5UQk1NMDR3WTIxc2QwcFVaRVJoVnpGb1dqSldWMkZYVmpOTmFUaDVURE5qZGsxVVNUQk5RUQ