摘要: 一、HashMap源码 https://blog.csdn.net/weixin_44324174/article/details/105645452 、 https://blog.csdn.net/wsdfym/article/details/109232470 二、HashMap面试题 http 阅读全文
posted @ 2021-06-15 23:40 暗夜消辰 阅读(35) 评论(0) 推荐(0) 编辑
摘要: HashMap在JDK1.8为什么改用使用尾插法 因为 1.7头插法扩容时,头插法会使链表发生反转,多线程环境下会产生环;A 线程在插入节点 B,B 线程也在插入,遇到容量不够开始扩容,重新 hash,放置元素,采用头插法,后遍历到的 B 节点放入了头部,这样形成了环。 1、假设容器大小为2,数组0 阅读全文
posted @ 2021-06-15 23:06 暗夜消辰 阅读(2327) 评论(0) 推荐(0) 编辑
摘要: 转载:https://blog.csdn.net/future_xiaowu/article/details/112241225?utm_term=int%E8%8C%83%E5%9B%B4%E6%98%AF2%E7%9A%84%E5%A4%9A%E5%B0%91%E6%AC%A1%E6%96%B9 阅读全文
posted @ 2021-06-15 22:47 暗夜消辰 阅读(936) 评论(0) 推荐(0) 编辑
摘要: 转载:https://blog.csdn.net/qq_26542493/article/details/88873168 一.ArrayList继承了AbstractList,实现了List接口,底层实现基于数组,因此可以认为是一个可变长度的数组。 二.在讲扩容机制之前,我们需要了解一下Array 阅读全文
posted @ 2021-06-15 18:52 暗夜消辰 阅读(69) 评论(0) 推荐(0) 编辑
摘要: 一、refresh debug模式,跟踪 SpringApplication.run() 启动方法,进入SpringApplication类,发现调用其refresh方法,该方法调用AbstractApplicationContext类的 refresh()。 public abstract cla 阅读全文
posted @ 2021-06-15 18:08 暗夜消辰 阅读(53) 评论(0) 推荐(0) 编辑