Java try-with-resources

不用再写繁琐的 finally。

Java try-with-resources速查图
图 11:Java try-with-resources(1080×1440 速查卡片)

自动关闭资源

多资源与关闭顺序

1. 总览 2. 是什么 3. 类层次 4. 非检查性 5. 内置异常 6. try-catch 7. 多重捕获 8. throw/throws 9. throws 声明 10. finally 12. 自定义异常 13. 实战示例 14. 最佳实践