1
0
mirror of https://github.com/Snailclimb/JavaGuide synced 2025-06-25 02:27:10 +08:00

修复显示问题

> 3.2.4

1. **适用范围(资源的定义):** 任何实现 `java.lang.AutoCloseable`或者 `java.io.Closeable` 的对象
This commit is contained in:
TTL 2021-01-04 17:38:40 +08:00 committed by GitHub
parent dc20d8f3d8
commit 89d7ebe41c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1240,7 +1240,7 @@ public class Test {
#### 3.2.4. 使用 `try-with-resources` 来代替`try-catch-finally` #### 3.2.4. 使用 `try-with-resources` 来代替`try-catch-finally`
1. **适用范围(资源的定义):** 任何实现 `java.lang.AutoCloseable`或者``java.io.Closeable` 的对象 1. **适用范围(资源的定义):** 任何实现 `java.lang.AutoCloseable`或者 `java.io.Closeable` 的对象
2. **关闭资源和 final 的执行顺序:**`try-with-resources` 语句中,任何 catch 或 finally 块在声明的资源关闭后运行 2. **关闭资源和 final 的执行顺序:**`try-with-resources` 语句中,任何 catch 或 finally 块在声明的资源关闭后运行
《Effecitve Java》中明确指出 《Effecitve Java》中明确指出