Quiz di Java: Checked vs Unchecked Exceptions

This Java quiz tests the difference between checked exceptions like IOException and unchecked ones like NumberFormatException. You will predict output, spot code that does not compile and decide what a method may declare with throws.

Medio 10 domande ~6 minuti Superato con il 80% Java 17

Scegli una modalità

Stai giocando come ospite: accedi per salvare XP e serie.

Domanda di esempio

Domanda 1 di 10

Which of these is a checked exception?

Mostra la risposta

B. IOException IOException extends Exception but not RuntimeException, so the compiler makes you catch or declare it. The other three extend RuntimeException, which makes them unchecked.

Cosa copre questo quiz

  • Checked exceptions vs RuntimeException and its subclasses
  • Declaring with throws and the "catch or declare" rule
  • Wrapping a checked exception with a cause
  • Catch order, multi-catch and exception subclasses
  • Checked exceptions inside lambdas and overriding methods

Domande frequenti

Serve un account?

No. Chiunque può giocare. Accedi per salvare XP, serie, badge e cronologia.

Posso rifarlo?

Sì. Il tuo miglior punteggio resta salvato, e domande e risposte vengono mescolate ogni volta.