Type a try/catch/finally structure for IOException
Type a try/catch/finally structure for IOException
Answer
try { process(); } catch (IOException e) { System.err.println(e.getMessage()); } finally { cleanup(); }
finally always runs — even if catch rethrows. Use it to release resources you cannot use try-with-resources for.