Java 7 features has autoclose of resource and multi-catch statement, but how it works internally in both cases?
For example
// Try with resource
public void testTryWithResourcesStatement() throws FileNotFoundException, IOException {
try (FileInputStream in = new FileInputStream("java7.txt")) {
System.out.println(in.read());
}
}
Here there is no need for finally. But how it works internally? How JVM closes it internally?