Multiple choice technology programming languages

a method cannot be declared as throwing more than one exception.

  1. True

  2. False

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

A method can declare throwing multiple exceptions using a comma-separated list in the method signature. For example: 'void myMethod() throws IOException, SQLException, CustomException {...}' is valid syntax. The throws clause can include any number of checked exceptions that the method might throw but not handle internally.