try-with-resources 是 Java 7 引入的一个新特性,主要用于自动管理资源,可以自动关闭实现了 java.lang.AutoCloseable 或者 java.io.Closeable 接口的资源。在 try 块执行完毕后,它会自动调用资源对象的 close..