Closing files, sockets or database connections in a manual finally block is tedious and bug-prone—especially if close() itself throws and masks the real exception from try. Java 7 introduced try-with-resources so any AutoCloseable closes automatically in reverse order while preserving primary exceptions.
More lessons in Complete Core Java