
源码
Irving_Ma
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
HashMap为什么最大容量是2^30
HashMap为什么最大容量是1<<30 描述 源码: /** * The maximum capacity, used if a higher value is implicitly specified * by either of the constructors with arguments. * MUST be a power of two <= 1&...原创 2020-04-13 13:59:05 · 1141 阅读 · 0 评论 -
HashMap初始容量为什么是16(必须是2的幂次方)?
# HashMap初始容量为什么必须是2的幂次方? ```java /** * The default initial capacity - MUST be a power of two. */ static final int DEFAULT_INITIAL_CAPACITY = 1 << 4; // aka 16 ``` ### 关键词 1. hash碰撞 2....原创 2020-04-13 12:00:07 · 805 阅读 · 0 评论