Java 源码解读
通过研读源码更好的知道代码时间,写出更棒的代码。通过专栏方式集合研读源码时候的感悟,更好地的分享给其他人
empcl
计划、过程、目标
展开
-
深入理解 hashcode 和 hash 算法
摘要 1. 二进制计算的一些基础知识 2. 为什么使用 hashcode 3. String 类型的 hashcode 方法 4. 为什么大部分 hashcode 方法使用 31 5. HashMap 的 hash 算法的实现原理(为什么右移 16 位,为什么要使用 ^ 位异或) 6. HashMap 为什么使用 & 与运算代替模运算? 7. HashMap 的容量为什么建议...转载 2019-04-08 00:06:31 · 659 阅读 · 1 评论 -
HashSet 源码分析 -- java 1.8
Java8 HashSet原理 概述 在官方文档中是这样描述HashSet的: This class implements the Set interface, backed by a hash table (actually a HashMap instance). It makes no guarantees as to the iteration order of the set; i...原创 2019-04-12 10:38:32 · 113 阅读 · 0 评论 -
HashMap原理分析 -- java 1.8
Java8 HashMap原理 概述 在官方文档中是这样描述HashMap的: Hash table based implementationofthe Map interface. This implementation provides allofthe optional map operations,andpermitsnullvaluesandthenullk...转载 2019-04-11 00:02:17 · 178 阅读 · 1 评论