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 objects are stored in memory?

0 Answers  


What are handlers in c#?

0 Answers  


What are the advantages of properties in c#?

0 Answers  


What is assembly version series sequence?

0 Answers  


What does assemblyinfo.cs consists ?

4 Answers   Microsoft,






What is a copy constructor in c#?

0 Answers  


How do you prevent a method from being overridden in c#?

0 Answers  


What is difference between string and stringbuffer in c#?

0 Answers  


How do you comment out code in c#?

0 Answers  


What will a loop recorder show?

0 Answers  


What is the difference between and xml documentation tag?

0 Answers  


What?s the difference between an interface and abstract class?

2 Answers   Patni,


Categories