Multiple choice technology programming languages

Can multiple catch blocks be executed for single try statement?

  1. True

  2. False

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

In C#, only one catch block executes for a single try statement. When an exception occurs, the runtime searches for the first matching catch block and executes it - other catch blocks are skipped even if they would also match the exception type. To handle multiple exception types, you need either multiple catch blocks in sequence (only one executes) or catch a base exception type and check the specific type within.