Question
Which of the following must be true of the object thrown by a throw statement?
- A. It must be assignable to the Throwable type.
- B. It must be assignable to the Error type.
- C. It must be assignable to the Exception type.
- D. It must be assignable to the String type.
A.
Note
The object thrown by a throw statement must be assignable to the Throwable type.
This includes the Error and Exception types.
PreviousNextRelated