1
0
mirror of https://github.com/Snailclimb/JavaGuide synced 2025-08-10 00:41:37 +08:00

Compare commits

..

No commits in common. "43e1fd4f5211e5c07b35eef1c82408a7042ef56e" and "ae8ae6cd3215c68a6c25e2ed2a548c8b9ec22562" have entirely different histories.

2 changed files with 5 additions and 5 deletions

View File

@ -115,7 +115,7 @@ Task 3
## DelayQueue 源码解析
这里以 JDK1.8 为例,分析一下 `DelayQueue` 的底层核心源码。
这里以 JDK1.8 为例,分析一下 `LinkedList` 的底层核心源码。
`DelayQueue` 的类定义如下:
@ -126,7 +126,7 @@ public class DelayQueue<E extends Delayed> extends AbstractQueue<E> implements B
}
```
`DelayQueue` 继承了 `AbstractQueue` 类,实现`BlockingQueue` 接口。
`DelayQueue` 实现了 `AbstractQueue` 类,继承`BlockingQueue` 接口。
![DelayQueue类图](https://oss.javaguide.cn/github/javaguide/java/collection/delayqueue-class-diagram.png)

View File

@ -215,7 +215,7 @@ static final class RunnableAdapter<T> implements Callable<T> {
工厂模式用于创建对象NIO 中大量用到了工厂模式,比如 `Files` 类的 `newInputStream` 方法用于创建 `InputStream` 对象(静态工厂)、 `Paths` 类的 `get` 方法创建 `Path` 对象(静态工厂)、`ZipFileSystem` 类(`sun.nio`包下的类,属于 `java.nio` 相关的一些内部实现)的 `getPath` 的方法创建 `Path` 对象(简单工厂)。
```java
InputStream is = Files.newInputStream(Paths.get(generatorLogoPath))
InputStream is Files.newInputStream(Paths.get(generatorLogoPath))
```
## 观察者模式