C# Exception Handling Aptitude Questions and Answers | Set 3

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

1) How many times can we use to try block in a C# program?
  1. 5 times
  2. 2 times
  3. Any number of times
  4. Only one time

2) There are following statements are given below, which is correct about catch block in C#.NET?
  1. The catch is not supported in C#.NET
  2. The catch block is used to catch on number related exceptions
  3. The catch block executes at least once during program execution
  4. The catch block is used to catch all types of exceptions that occurred in a try block, depends upon its exception class

3) There are following statements are given below, which is correct about finally block in C#.NET?
  1. The finally block is not supported in C#.NET
  2. The finally block is also used to catch exceptions
  3. The finally block can contain only a single statement inside it
  4. The finally block execute at least once, whether exception caught in block or not

4) Can we use a catch block without using a try block in C#.Net?
  1. Yes
  2. No

5) If we define a try block and did not define any catch or finally block, will it work?
  1. Yes
  2. No





Comments and Discussions!

Load comments ↻





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