What is the use of giving more than one CATCH BLOCK in one
TRY block? Directly we can give that catch(Exception e)?Why
we go for arrayoutofbound Exception,divided by zero etc..?
Explain

Answers were Sorted based on User's Feedback



What is the use of giving more than one CATCH BLOCK in one TRY block? Directly we can give that cat..

Answer / kavitha

try with single catch block will catch what ever the
exception thrown by the code inside the try block but it
will not be clear..some time a code in a try block can throw
different type of exception.To catch the different type of
exception what our code throws we can use difference type
of catch for the single try block it will be more clear and
help full.

Is This Answer Correct ?    6 Yes 0 No

What is the use of giving more than one CATCH BLOCK in one TRY block? Directly we can give that cat..

Answer / raman

C# is not only an object oriented but real
scenariodevelopment.
Purpose of multiple catch block is to map the exact error
and handle it accordingly. Handling Exception e is the
worst type of development.

Is This Answer Correct ?    6 Yes 2 No

Post New Answer

More C Sharp Interview Questions

Is c# substring zero based?

0 Answers  


When Doveloped C#

2 Answers  


What is abstract class ?

5 Answers   Digital GlobalSoft,


What is view model in c#?

0 Answers  


How to make a class non-inheritable other than sealed?

7 Answers  






Write a short note on interface?

0 Answers  


Can you declare the override method static while the original method is non-static?

3 Answers  


What is a dbml?

0 Answers  


What is inheritance c#?

0 Answers  


What is the difference between == and object.equals?

0 Answers  


How do partial classes work in c#?

0 Answers  


Is multiple inheritance possible in c#?

0 Answers  


Categories