The catch clause
argument is always of type___________.
A.
Exception
Exception
B.
Exception but NOT including RuntimeException
Exception but NOT including RuntimeException
C.
Throwable
Throwable
D.
RuntimeException
RuntimeException
E.
CheckedException
CheckedException
F.
Error
Error
Risposta C. Sebbene tutte le eccezioni derivino da Exception tutti gli errori java sono figli di Throwable. La classe Exception indica filosoficamente quali errori meritano di essere catturati. Quindi anche se è concettualmente errato pensare di catturare Throwable, tuttavia non è tecnicamente scorretto.

Nessun commento:
Posta un commento