C# - Exception Handling Questions and Answers

Take Exam

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
Show Answer Report

22. Which exception is thrown for invalid cast operations?

  • TypeException
  • CastException
  • InvalidCastException
  • ConversionException
Show Answer Report

23. What is exception bubbling?

  • Creating multiple exceptions
  • Exception propagating up call stack
  • Catching all exceptions
  • Ignoring exceptions
Show Answer Report

24. Which method returns exception information?

  • GetMessage()
  • ToString()
  • GetException()
  • PrintStackTrace()
Show Answer Report

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
Show Answer Report

26. Which exception is thrown for array index out of bounds?

  • ArrayException
  • IndexOutOfRangeException
  • BoundaryException
  • ArrayBoundException
Show Answer Report

27. What is the order of exception handling blocks?

  • catch-finally-try
  • try-catch-finally
  • finally-try-catch
  • catch-try-finally
Show Answer Report

28. Which exception is thrown for file not found?

  • FileException
  • FileNotFound
  • FileNotFoundException
  • MissingFileException
Show Answer Report

29. What is the purpose of the throw statement without exception?

  • Throws new exception
  • Re-throws current exception
  • Ignores exception
  • Creates custom exception
Show Answer Report

30. Which property provides exception message?

  • Description
  • Error
  • Message
  • Text
Show Answer Report
Questions and Answers for Competitive Exams Various Entrance Test