Java Foundations — Question 20

Which statement is true about exception handling?

Answer options

Correct answer: D

Explanation

The correct answer is D because in exception handling, catch blocks should be ordered from the most general exceptions to the most specific to ensure that the correct handler is invoked. Option A is incorrect because a try statement can exist without a catch block if there is a finally block. Option B is false as the execution of a try block stops as soon as an exception is thrown. Option C is incorrect because it's not mandatory for a try block to throw an exception.