This can be declared inside the try block using try-with-resources.