~/ learn/ java-from-zero/ cards/ Exceptions
1 of 20

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/8fa37489-d406-4464-b339-c068afe9014a/flashcard utf-8 LF