Java OCA OCP Practice Question 637

Question

Which of the following classes will handle all types in a catch block?

  • A. Exception
  • B. Error
  • C. Throwable
  • D. RuntimeException


C.

Note

All exceptions in Java inherit from Throwable, making Option C the correct answer.

Error and Exception extend Throwable, and RuntimeException extends Exception.




PreviousNext

Related