C# MCQ Questions And Answers - Exception Handling

This section focuses on "Exception Handling" in C#. These Multiple Choice Questions (MCQs) should be practiced to improve the C# skills required for various interviews (campus interviews, walk-in interviews, company interviews), placements, entrance exams and other competitive examinations.

1. An exception is a problem that arises?

A. before the execution of a program
B. during the execution of a program
C. after the execution of a program
D. none of the above

View Answer


2. C# exception handling is built upon __________ keywords.

A. One
B. Two
C. Three
D. Four

View Answer


3. The _________ keyword indicates the catching of an exception.

A. Try
B. Throw
C. Catch
D. Finally

View Answer


4. The exception classes in C# are mainly directly or indirectly derived from the?

A. System.Exception class
B. Exception class
C. System.ApplicationException class
D. ApplicationException class

View Answer


5. The ________________ class is the base class for all predefined system exception

A. System.ApplicationException
B. System.SystemException
C. System.IO.IOException
D. System.IndexOutOfRangeException

View Answer


6. Which exception class Handles errors generated during typecasting?

A. System.NullReferenceException
B. System.StackOverflowException
C. System.InvalidCastException
D. System.OutOfMemoryException

View Answer


7. Which among the following is considered as .NET Exception class?

A. Exception
B. File bound Exception
C. StackUnderflow Exception
D. All of the above

View Answer


8. Which of the following is the object oriented way to handle run time errors?

A. Error codes
B. HERRESULT
C. OnError
D. All of the above

View Answer


9. Which of the following is the wrong statement about exception handling in C#.NET?

A. finally clause is used to perform cleanup operations of closing network and database connections
B. a program can contain multiple finally clauses
C. the statement in final clause will get executed no matter whether an exception occurs or not
D. None of the above

View Answer


10. Incorrect Arithmetic Expression is NOT an exception.

A. TRUE
B. FALSE
C. Can be true or false
D. Can not say

View Answer





Discussion



* You must be logged in to add comment.