Try With Resources vs Try-Catch [duplicate]
The main point of try-with-resources is to make sure resources are closed reliably without possibly losing information. When you don’t use try-with-resources there’s a potential pitfall called exception-masking. When code in a try block throws an exception, and the close method in the finally also throws an exception, the exception thrown by the try block … Read more