Glossary: Java Beyond the Basics
Try-with-resources
Also written: try-with-resources
try (resource) { ... } closes the resource when the block ends, even after an exception. It works with any AutoCloseable, such as files and executors.
Glossary: Java Beyond the Basics
Also written: try-with-resources
try (resource) { ... } closes the resource when the block ends, even after an exception. It works with any AutoCloseable, such as files and executors.