Software Engineering
Which catch block should be written first when handling multiple exceptions?
Show answer
Correct answer: C) Specific
Specific exceptions should be caught before general ones to avoid being overshadowed.
Writing a general exception first can prevent specific exception blocks from executing.
Explanation
Specific exceptions should be caught before general ones to avoid being overshadowed.
Writing a general exception first can prevent specific exception blocks from executing.