Exercise 176: Java Exceptions & Try-With-Resources
Read Lesson →Execute cleanup code regardless of whether an exception occurred:
try { ... } catch (Exception e) { ... }
{ cleanup(); }
Execute cleanup code regardless of whether an exception occurred: