~/ learn/ comp-308/ cards/ Checked vs unchecked & the exception hierarchy
1 of 6

Declare a method that throws a checked exception

Declare a method that throws a checked exception

Answer

void loadEvents(String file) throws IOException { // may throw IOException }

A checked exception that is not caught here must be declared in the signature, transferring the obligation to callers.

space flip · ← → navigate · esc to exit
NORMAL ~/memra/library/27f5163f-390e-4c37-893d-a9e195435bba/flashcard utf-8 LF