C# Programming - Exception Handling - Discussion

Discussion Forum : Exception Handling - General Questions (Q.No. 5)
5.
Which of the following statements are correct about exception handling in C#.NET?
  1. If an exception occurs then the program terminates abruptly without getting any chance to recover from the exception.
  2. No matter whether an exception occurs or not, the statements in the finally clause (if present) will get executed.
  3. A program can contain multiple finally clauses.
  4. A finally clause is written outside the try block.
  5. finally clause is used to perform clean up operations like closing the network/database connections.
1 only
2 only
2 and 5 only
3 and 4 only
None of the above
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
11 comments Page 2 of 2.

Surafel Kassahun said:   4 years ago
C# does not allow multiple finally blocks! And also finally block may or may not run every time depending on the type of exception that occurred.


Post your comments here:

Your comments will be displayed after verification.