Java 7功能具有 autoclose 资源和多捕获语句,但在两种情况下如何内部?
例如
// Try with resource
public void testTryWithResourcesStatement() throws FileNotFoundException, IOException {
try (FileInputStream in = new FileInputStream("java7.txt")) {
System.out.println(in.read());
}
}
此处不需要最终。但它在内部如何运作? JVM如何在内部关闭它?