Bird
Raised Fist0

Which of the following exceptions is NOT derived from SystemException?

easy🧠 Conceptual Q2 of Q15
C Sharp (C#) - Exception Handling
Which of the following exceptions is NOT derived from SystemException?
ANullReferenceException
BIndexOutOfRangeException
CArgumentException
DFileNotFoundException
Step-by-Step Solution
Solution:
  1. Step 1: Identify exceptions derived from SystemException

    Exceptions like NullReferenceException, IndexOutOfRangeException, and ArgumentException inherit from SystemException.
  2. Step 2: Check FileNotFoundException's base class

    FileNotFoundException inherits from IOException, which is a subclass of Exception but not SystemException.
  3. Final Answer:

    FileNotFoundException -> Option D
  4. Quick Check:

    FileNotFoundException not under SystemException [OK]
Quick Trick: FileNotFoundException inherits IOException, not SystemException [OK]
Common Mistakes:
MISTAKES
  • Assuming all exceptions inherit SystemException
  • Confusing IOException with SystemException

Want More Practice?

15+ quiz questions · All difficulty levels · Free

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