adplus-dvertising
frame-decoration

Question

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.

a.

1 only

b.

2 only

c.

2 and 5 only

d.

3 and 4 only

Answer: (c).2 and 5 only

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. 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...

Similar Questions

Discover Related MCQs

Q. Which of the following is the Object Oriented way of handling run-time errors?

Q. Exceptions can be thrown even from a constructor, whereas error codes cannot be returned from a constructor.

Q. All code inside finally block is guaranteed to execute irrespective of whether an exception occurs in the protected block or not.

Q. Which of the following is NOT an Exception?

Q. It is compulsory for all classes whose objects can be thrown with throw statement to be derived from System.Exception class.

Q. Which of the following statements is true about an enum used in C#.NET?

Q. An enum that is declared inside a class, struct, namespace or interface is treated as public.

Q. An enum can be declared inside a class, struct, namespace or interface.

Q. Which of the following CANNOT be used as an underlying datatype for an enum in C#.NET?

Q. Which of the following statements is correct about an enum used in C#.NET?

Q. Choose the correct statement among the followings?

Q. Choose the keyword which declares the indexer?

Q. Choose the operator/operators which is/are not used to access the [] operator in indexers?

Q. Choose the correct statement among the following?

Q. Which among the following are the advantages of using indexers?

Q. Choose the correct statement about properties describing the indexers?

Q. Choose the correct alternative that utilizes the indexed property such that a group named class has indexed property which stores or retrieves value to/from an array of 5 numbers?

Q. Choose the correct option among the following indexers which correctly allows to index in same way as an array?

Q. Choose the wrong statement about the properties used in C#.NET?

Q. Choose the statements which makes use of essential properties rather than making data member public in C#.NET?