~/ learn/ java-from-zero/ cards/ The Throwable hierarchy: checked vs unchecked
1 of 4

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.

space flip · ← → navigate · esc to exit
NORMAL ~/memra/library/e17f6566-5fd0-4dc0-a6b0-8b23459362fb/flashcard utf-8 LF