Multiple choice

Which of the following statements is/are correct? A. A finally block is optional. B. throw and throws are the same.

  1. Only A

  2. Only B

  3. Both A and B

  4. Neither A nor B

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

A finally block is optional. The keyword throw and throws are not the same. The keyword throws is used in method definition to represent that a method may possibly throw an exception.