File tree Expand file tree Collapse file tree 16 files changed +442
-74
lines changed Expand file tree Collapse file tree 16 files changed +442
-74
lines changed Original file line number Diff line number Diff line change @@ -748,3 +748,6 @@ class Person {
748748
749749- 周志明. 深入理解 Java 虚拟机 [ M] . 机械工业出版社
750750
751+
752+
753+ ![ ] ( https://raw.githubusercontent.com/Tyson0314/img/master/20220612101342.png )
Original file line number Diff line number Diff line change @@ -924,7 +924,7 @@ public class Student extends Person {
924924
9259251、** 语法层面** 上的区别
926926
927- - 抽象类可以有方法实现,而接口的方法中只能是抽象方法;
927+ - 抽象类可以有方法实现,而接口的方法中只能是抽象方法(Java 8 开始接口方法可以有默认实现) ;
928928- 抽象类中的成员变量可以是各种类型的,接口中的成员变量只能是public static final类型;
929929- 接口中不能含有静态代码块以及静态方法,而抽象类可以有静态代码块和静态方法;
930930- 一个类只能继承一个抽象类,而一个类却可以实现多个接口。
@@ -1163,3 +1163,9 @@ Java语言的关键字,变量修饰符,如果用transient声明一个实例
11631163Java泛型是JDK 5中引⼊的⼀个新特性, 允许在定义类和接口的时候使⽤类型参数。声明的类型参数在使⽤时⽤具体的类型来替换。
11641164
11651165泛型最⼤的好处是可以提⾼代码的复⽤性。以List接口为例,我们可以将String、 Integer等类型放⼊List中, 如不⽤泛型, 存放String类型要写⼀个List接口, 存放Integer要写另外⼀个List接口, 泛型可以很好的解决这个问题。
1166+
1167+ ## String为什么不可变?
1168+
1169+
1170+
1171+ ![ ] ( https://raw.githubusercontent.com/Tyson0314/img/master/20220612101342.png )
Original file line number Diff line number Diff line change @@ -569,8 +569,8 @@ synchronized 修饰的方法并没有 `monitorenter` 指令和 `monitorexit` 指
569569
570570** 相同点** :
571571
572- 1 . 使当前线程暂停运行 ,把机会交给其他线程
573- 2 . 任何线程在等待期间被中断都会抛出 ` InterruptedException `
572+ 1 . 它们都可以使当前线程暂停运行 ,把机会交给其他线程
573+ 2 . 任何线程在调用wait()和sleep()之后,在等待期间被中断都会抛出 ` InterruptedException `
574574
575575** 不同点** :
576576
@@ -1146,3 +1146,7 @@ SynchronizedMap一次锁住整张表来保证线程安全,所以每次只能
11461146
11471147JDK1.8 ConcurrentHashMap采用CAS和synchronized来保证并发安全。数据结构采用数组+链表/红黑二叉树。synchronized只锁定当前链表或红黑二叉树的首节点,支持并发访问、修改。
11481148另外ConcurrentHashMap使用了一种不同的迭代方式。当iterator被创建后集合再发生改变就不再是抛出ConcurrentModificationException,取而代之的是在改变时new新的数据从而不影响原有的数据 ,iterator完成后再将头指针替换为新的数据 ,这样iterator线程可以使用原来老的数据,而写线程也可以并发的完成改变。
1149+
1150+
1151+
1152+ ![ ] ( https://raw.githubusercontent.com/Tyson0314/img/master/20220612101342.png )
Original file line number Diff line number Diff line change @@ -595,3 +595,7 @@ http://www.importnew.com/20386.html
595595https://www.cnblogs.com/yangming1996/p/7997468.html
596596
597597https://coolshell.cn/articles/9606.htm(HashMap 死循环)
598+
599+
600+
601+ ![ ] ( https://raw.githubusercontent.com/Tyson0314/img/master/20220612101342.png )
Original file line number Diff line number Diff line change 137137
138138# 计算机网络
139139
140- [ 【大厂面试】—— 计算机网络常见面试题总结] ( 网络/计算机网络高频面试题.md ) (** 知乎1k+收藏!推荐 :+1 : ** )
140+ [ 【大厂面试】—— 计算机网络常见面试题总结] ( 计算机基础/ 网络/计算机网络高频面试题.md) (** 知乎1k+收藏!推荐 :+1 : ** )
141141
142- [ session和cookie详解] ( 网络/session和cookie.md )
142+ [ session和cookie详解] ( 计算机基础/ 网络/session和cookie.md)
143143
144144# 数据结构与算法
145145
146146[ 如何高效的刷LeetCode?] ( https://www.zhihu.com/question/280279208/answer/2377906738 )
147147
148- [ 7种常见的排序算法Java代码实现] ( 数据结构与算法/常见的排序算法Java代码实现.md )
148+ [ 7种常见的排序算法Java代码实现] ( 计算机基础/ 数据结构与算法/常见的排序算法Java代码实现.md)
149149
150- [ 二叉树前序、中序、后序、层序遍历代码实现] ( 数据结构与算法/二叉树前序、中序、后序、层序遍历代码实现.md )
150+ [ 二叉树前序、中序、后序、层序遍历代码实现] ( 计算机基础/ 数据结构与算法/二叉树前序、中序、后序、层序遍历代码实现.md)
151151
152- [ 常见数据结构总结] ( 数据结构与算法/数据结构.md )
152+ [ 常见数据结构总结] ( 计算机基础/ 数据结构与算法/数据结构.md)
153153
154154# 设计模式
155155
201201| 2021.11.25 | 支付宝收款码 | * 海 | 1元 | |
202202| 2021.12.10 | 微信收款码 | 浩* y | 10元 | |
203203| 2021.12.15 | 微信收款码 | biubiu* | 6.66元 | 好 |
204+ | 2022.02.17 | 微信收款码 | * 齐 | 8元 | |
205+ | 2022.05.03 | 微信收款码 | * 哈 | 2元 | |
204206
205207
206208
Original file line number Diff line number Diff line change 2929
3030<!-- END doctoc generated TOC please keep comment here to allow auto update -->
3131
32- > 本文已经收录到github仓库,此仓库用于分享Java相关知识总结,包括Java基础、MySQL、Spring Boot、MyBatis、Redis、RabbitMQ、计算机网络、数据结构与算法等等,欢迎大家提pr和star!
33- >
34- > github地址:https://github.com/Tyson0314/Java-learning
35- >
36- > 如果github访问不了,可以访问gitee仓库。
37- >
38- > gitee地址:https://gitee.com/tysondai/Java-learning
39-
40- 文章目录:
41-
42- ![ ] ( https://raw.githubusercontent.com/Tyson0314/img/master/image-20210914234334988.png )
43-
4432# 简介
4533
4634RabbitMQ是一个由erlang开发的消息队列。消息队列用于应用间的异步协作。
@@ -430,3 +418,6 @@ msg.getMessageProperties().setExpiration("3000");
430418
431419[ 线上rabbitmq问题] ( https://juejin.im/post/6844904088212094983#heading-0 )
432420
421+
422+
423+ ![ ] ( https://raw.githubusercontent.com/Tyson0314/img/master/20220612101342.png )
You can’t perform that action at this time.
0 commit comments