Is there an elegant way to handle exceptions that are thrown in finally block?
finally
For example:
try { // Use the resource. } catch( Excep
Changing Resource from best answer to Closeable
Resource
Streams implements Closeable Thus you can reuse the method for all streams
Closeable
protected void closeQuietly(Closeable resource) { if (resource == null) return; try { resource.close(); } catch (IOException e) { //log the exception } }