Bird
Raised Fist0

If no exception occurs in the try block, which blocks will execute?

easy🧠 Conceptual Q2 of Q15
C Sharp (C#) - Exception Handling
If no exception occurs in the try block, which blocks will execute?
ATry and finally blocks
BTry and catch blocks
COnly the try block
DCatch and finally blocks
Step-by-Step Solution
Solution:
  1. Step 1: Analyze normal execution flow

    If no exception occurs, the catch block is skipped because there is nothing to catch.
  2. Step 2: Check which blocks run

    The try block runs, then the finally block always runs regardless of exceptions.
  3. Final Answer:

    Try and finally blocks -> Option A
  4. Quick Check:

    No exception = try + finally run [OK]
Quick Trick: catch runs only if exception occurs; finally always runs [OK]
Common Mistakes:
MISTAKES
  • Assuming catch runs even without exceptions
  • Thinking finally runs only on exceptions
  • Ignoring finally block execution

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More C Sharp (C#) Quizzes