JDK 7 和 JDK 8 的区别 简介 容易记的 jdk8支持接口可以添加默认方法, default; jdk8支持lambda表达式 jdk7中hashmap解决冲突采用链表, 一旦hash碰撞过多, 可能会使得一个链表上存在多个节点, 查找是花费O(n) jdk8hashmap当链表超过8个时, 采用红黑树的结构, 提高了链表的查找速度 jdk8扩容不是重新计算所有元素在数组的位置, 元素的位置要么在原位置, 要么在原位置再移动2次幂. 参考链接 https://blog.csdn.net/weixin_43115433/article/details/94034556?utm_medium=distribute.pc_relevant.none-task-blog-baidujs_baidulandingword-0&spm=1001.2101.3001.4242 https://blog.csdn.net/tawlang/article/details/78207091 Hope is a good thing,maybe the best of things,and no good thing ever dies.----------- Andy Dufresne