OCA Java SE 8 Mock Exam - OCA Mock Question 39
Question
Select the correct option(s):
- Runtime exceptions are checked exceptions.
- If a method throws a checked exception, it must be either handled by the method or specified in its throws clause.
- You should not handle errors.
- If a method throws a runtime exception, it may include the exception in its throws clause.
- You cannot handle runtime exceptions.
Answer
Note
A is incorrect. Runtime exception and all its subclasses are not checked exceptions.
E is incorrect. You can handle runtime exceptions the way you
can handle a checked exception in your code: using a try-catch block.