Hi,
Requirement is:
try
{
\\SQL Query
}
catch(Exception i)
{
print a
}
catch(SQLQueryException e)
{
\\SQL Query
}
Got Exception in "try" block. Which "catch" throws
exception and Why???

Please provide the answer in detail..

Thanks for the help!!!

Answer Posted / syed

The generic exception (Catch(Exception e)) should be
written after all the specific exceptions are written.
if any specific exception is written after the general
exception that will be of no use, as for all the exceptions
that were encountered in the try block will be catched by
the generic exception.
hope u got it.

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Tell us why do we use the “using” statement?

547


What is the new three features of COM+ services, which are not there in COM (MTS)

1537


Explain the difference between constants and read-only variables?

571


What is managed code and managed data in .net?

593


Is .net is a language?

563






What are the differences between an interface and an abstract class in .net?

514


What is the native image generator?

602


Is .net core managed code?

522


How do you define the lease of the object in .net?

558


If I am writing in a language like vb or c++, what are the procedures to be followed to support .net?

579


What are the features of dot net?

534


What is difference between static page and dynamic page?

530


Explain .net framework overview?

587


Why inheritance is important?

548


What is the difference between reference type and value type?

512