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

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we override interface methods in c#?

648


Can you explain template pattern?

752


Which function is the entry point for a DLL in MS Windows 3.1?

873


how to print invert pyramid in c#

1489


Explain the functionalities of satellite assembly?

728


Which of the following API is used to hide a window?

762


What do you mean by sealed classes and static classes?

718


What is string concatenation?

673


What is c# in asp net?

655


Can the nested class access, the containing class. Give an example?

654


What are the new features in c# 2.0?

708


How is the syntax written to inherit from a class in C#?Give an example ?

783


Explain the difference between Response.Write () and Response.Output.Write ().

714


Which is faster iqueryable or ienumerable?

747


Which program construct must return a value?

753