Jdk源码解析(1)

  • Holds cached entrySet(). Note that AbstractMap fields are used

  • for keySet() and values().

*/

// 保存缓的entrySet(),注意点 这个AbstractMap字段被用于keySet()和values()。

// 父类AbstractMap public abstract Set<Entry<K,V>> entrySet();

// -####拓展源码##----》当前类下搜索即可

transient Set<Map.Entry<K,V>> entrySet;

/**

  • Returns a {@link Set} view of the mappings contained in this map.

  • The set is backed by the map, so changes to the map are

  • reflected in the set, and vice-versa. If the map is modified

  • while an iteration over the set is in progress (except through

  • the iterator’s own remove operation, or through the

  • setValue operation on a map entry returned by the

  • iterator) the results of the iteration are undefined. The set

  • supports element removal, which removes the corresponding

  • mapping from the map, via the Iterator.remove,

  • Set.remove, removeAll, retainAll and

  • clear operations. It does not support the

  • add or addAll operations.

// 返回 这个map中包含的一个映射set视图

  • @return a set view of the mappings contained in this map

*/

public Set<Map.Entry<K,V>> entrySet() {

Set<Map.Entry<K,V>> es;

return (es = entrySet) == null ? (entrySet = new EntrySet()) : es;

}

/**

  • The number of key-value mappings contained in this map.

*/

// 这个map中包含的key-value的数量

transient int size;

/**

  • The number of times this HashMap has been structurally modified

  • Structural modifications are those that change the number of mappings in

  • the HashMap or otherwise modify its internal structure (e.g.,

  • rehash). This field is used to make iterators on Collection-views of

  • the HashMap fail-fast. (See ConcurrentModificationException).

*/

// 这个map在结构上被修改的次数,结构修改是指那些改变hashMap的映射数量或

// 其他方式修改其内部结构的修改 例如:rehash。这个字段用于使HashMap集合视图上做迭代器操作的快速失败。

// 参考:ConcurrentModificationException

transient int modCount;

/**

  • The next size value at which to resize (capacity * load factor).

  • 用于调整大小的下一个size的值 (容量*负载因子)

  • @serial

*/

// (The javadoc description is true upon serialization.

// Additionally, if the table array has not been allocated, this

// field holds the initial array capacity, or zero signifying

// DEFAULT_INITIAL_CAPACITY.)

// 如果数组table没有分配,此字段将保留初始数组容量,或使用零标志·表示 DEFAULT_INITIAL_CAPACITY

int threshold;

/**

  • The load factor for the hash table.

  • hash表的加载因子

最后

由于篇幅有限,这里就不一一罗列了,20道常见面试题(含答案)+21条MySQL性能调优经验小编已整理成Word文档或PDF文档

MySQL全家桶笔记

还有更多面试复习笔记分享如下

Java架构专题面试复习

能调优经验**小编已整理成Word文档或PDF文档

[外链图片转存中…(img-A03dUyep-1714503368240)]

还有更多面试复习笔记分享如下

[外链图片转存中…(img-mXVakQwZ-1714503368240)]

本文已被CODING开源项目:【一线大厂Java面试题解析+核心总结学习笔记+最新讲解视频+实战项目源码】收录

  • 24
    点赞
  • 17
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值