C# - Exception Handling Questions and Answers
C# Exception Handling is a crucial topic in programming interviews and technical assessments. This section provides comprehensive programming questions and answers related to handling runtime errors in C#. Understanding exception handling helps developers write reliable code that gracefully manages unexpected events using constructs like try, catch, finally, and throw. These C# programming MCQs and interview-based examples are often seen in company placement tests such as TCS, Infosys, Wipro, and Capgemini. Practicing these C# exception handling questions with answers will strengthen your understanding of error handling and help you prepare for real-world coding challenges as well as competitive programming rounds.
C# - Exception Handling
Showing 10 of
30 questions
21. What does the catch block without parameters catch?
- No exceptions
- Only system exceptions
- Only application exceptions
- All exceptions
22. Which exception is thrown for invalid cast operations?
- TypeException
- CastException
- InvalidCastException
- ConversionException
23. What is exception bubbling?
- Creating multiple exceptions
- Exception propagating up call stack
- Catching all exceptions
- Ignoring exceptions
24. Which method returns exception information?
- GetMessage()
- ToString()
- GetException()
- PrintStackTrace()
25. What is the purpose of custom exceptions?
- To replace all built-in exceptions
- To handle application-specific errors
- To improve performance
- To reduce code size
26. Which exception is thrown for array index out of bounds?
- ArrayException
- IndexOutOfRangeException
- BoundaryException
- ArrayBoundException
27. What is the order of exception handling blocks?
- catch-finally-try
- try-catch-finally
- finally-try-catch
- catch-try-finally
28. Which exception is thrown for file not found?
- FileException
- FileNotFound
- FileNotFoundException
- MissingFileException
29. What is the purpose of the throw statement without exception?
- Throws new exception
- Re-throws current exception
- Ignores exception
- Creates custom exception