Multiple choice technology programming languages

If method A declares that it throws an exception and method B calls method A,then method B must ALWAYS declare the same exception.

  1. True

  2. False

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

Method B only needs to declare the exception if it doesn't catch it. If B uses try-catch to handle A's exception, no declaration is needed. The rule applies only when propagating exceptions up the call stack.