C# - Exception Handling Questions and Answers
Practice ModeShowing 10 of 30 questions
Q21
What does the catch block without parameters catch?
Answer: Option D
Explanation: Parameterless catch handles all exception types.
Q22
Which exception is thrown for invalid cast operations?
Answer: Option C
Explanation: InvalidCastException occurs on invalid type casting.
Q23
What is exception bubbling?
Answer: Option B
Explanation: Exception propagates up the call stack until caught.
Q24
Which method returns exception information?
Answer: Option B
Explanation: ToString() provides detailed exception information.
Q25
What is the purpose of custom exceptions?
Answer: Option B
Explanation: Custom exceptions handle application-specific errors.
Q26
Which exception is thrown for array index out of bounds?
Answer: Option B
Explanation: IndexOutOfRangeException for invalid array indices.
Q27
What is the order of exception handling blocks?
Answer: Option B
Explanation: Try-catch-finally is the standard sequence.
Q28
Which exception is thrown for file not found?
Answer: Option C
Explanation: FileNotFoundException for missing files.
Q29
What is the purpose of the throw statement without exception?
Answer: Option B
Explanation: Re-throws current exception in catch block.
Q30
Which property provides exception message?
Answer: Option C
Explanation: Message property contains error description.