The Java Development Kit 1.7 (JDK 1.7) introduced the try
-with-resources statement (see the JLS, §14.20.3, "try
-with-resources" [JLS 2013]), which simplifies correct use of resources that implement the java.lang.AutoCloseable
interface, including those that implement the java.io.Closeable
interface.
...