C# - Exception Handling Questions and Answers
Practice ModeShowing 10 of 30 questions
Q1
Which of the following is NOT a .NET Exception class?
Answer: Option B
Q2
Which of the following statements is correct about an Exception?
Answer: Option C
Q3
In C#.NET if we do not catch the exception thrown at runtime then which of the following will catch it?
Answer: Option B
Q4
Which of the following statements are correct about exception handling in C#.NET?
If our program does not catch an exception then the .NET CLR catches it.
It is possible to create user-defined exceptions.
All types of exceptions can be caught using the Exception class.
CLRExceptions is the base class for all exception classes.
For every try block there must be a corresponding finally block.
Answer: Option B
Q5
Which of the following is the Object Oriented way of handling run-time errors?
Answer: Option C
Q6
Which of the following statements are correct about exception handling in C#.NET?
try blocks cannot be nested.
In one function, there can be only one try block.
An exception must be caught in the same function in which it is thrown.
All values set up in the exception object are available in the catch block.
While throwing a user-defined exception multiple values can be set in the exception, object.
Answer: Option D
Q7
Exceptions can be thrown even from a constructor, whereas error codes cannot be returned from a constructor.
Answer: Option A
Q8
All code inside finally block is guaranteed to execute irrespective of whether an exception occurs in the protected block or not.
Answer: Option A
Q9
Which of the following is NOT an Exception?
Answer: Option D
Q10
It is compulsory for all classes whose objects can be thrown with throw statement to be derived from System.Exception class.
Answer: Option B