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

How long can a string be c#?

0 Answers  


For a combobox and a listbox same datatable given as a datasource. Now problem is that whenever focus of listbox changes selected value of combobox also get change or vice versa. what to be done to avoid this. According to requirement we cannot make different datasouce.

2 Answers   Syntel,


what are windows services?

0 Answers  


What is difference between private and static constructor?

0 Answers  


What is getenumerator?

0 Answers  


Any .net training centers available near hitech city , hyderabad?

2 Answers  


What is the difference between C# 3.5 and C# 4.0?

0 Answers  


What is strong name in c# and how can we use it?

0 Answers   DELL,


Name the property of the textbox which cannot be changed at runtime?

0 Answers  


When should I use static in C#?

0 Answers   SwanSoft Technologies,


What is appdomain in c#?

0 Answers  


What is deferred execution?

0 Answers  


Categories