Since its introduction in Java 7, the try-with-resources syntax has allowed us to safely and automatically close file and network connections. It is an essential technique for preventing memory leaks ...