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

explain Garbage collector’s functionality on unmanaged code

0 Answers   DELL,


What are access modifiers in c#?

0 Answers  


What are the differences between a class and a struct?

0 Answers  


What is Implementation inheritance and interface inheritance?

0 Answers  


What is the default value of datetime in c#?

0 Answers  






what is the lifespan of the items stored in viewstate ?

4 Answers  


can we declare a variable by name "this" in a class? Please explain?

3 Answers   IBM,


What is a type c#?

0 Answers  


What is arraylist class in c#?

0 Answers  


Is c sharp free?

0 Answers  


What is the use of dll file in c#?

0 Answers  


Do void methods have parameters?

0 Answers  


Categories