~/ 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/380f7d77-1917-4278-a1a0-aa09a895f61b/flashcard utf-8 LF