~/ 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/e5b5d7b5-0da2-43fc-a3dc-0d88be881a61/flashcard utf-8 LF