https://docs.oracle.com/javase/7/docs/api/java/lang/AutoClos...
You can even leave out the finally when you use an autocloseable resource.
//r will be closed no matter what try(Resource r = getResource()) { } catch(SomeException e) { }