C# Exception Handling Aptitude Questions and Answers | Set 2

C# Exception Handling Aptitude Questions | Set 2: This section contains aptitude questions and answers on C# Exception Handling.
Submitted by Nidhi, on April 16, 2020

1) There are the following statements that are given below, which is correct about an exception in C#.NET?
  1. The exception occurs at the time of compilation
  2. The exception occurs during program loading
  3. The exception occurs during JIT compilation
  4. The exception occurs during program execution

2) In C#.NET, we write a program that generates a runtime error, and we did not write code to catch the exception, then which of the following will catch it?
  1. Common Language Runtime
  2. Operating System
  3. C# compiler
  4. Linker

3) There are following options are given below, which is not useful to handle an exception in C#.Net?
  1. try
  2. catch
  3. errorcode
  4. finally

4) There are following statements are given below, which is correct about try block in C#.NET?
  1. The try block is used to handle all types of exceptions and avoid program crashes
  2. We need to write code that can generate an exception inside the try block
  3. The try block executes completely whether an exception occurs or not
  4. The try block is used to catch exception generated at runtime

5) Can we use multiple catch blocks associated with try block in C#.NET?
  1. Yes
  2. No






Comments and Discussions!

Load comments ↻






Copyright © 2024 www.includehelp.com. All rights reserved.