how do you do exception management

Answer Posted / manish agrahari

try
{
//try and do something here...
}
catch (SomeExeption ex)
{
//Handle the exception and take appropriate action
}
finally
{
//This code will *always* run irrespective if you have
//an exception or not. Usually this is some clean up of
//some sort though.
}

Is This Answer Correct ?    15 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is c# slower than java?

484


Is null or empty in c#?

547


Can you inherit multiple abstract classes in c#?

502


what is an event? Define delegate?

534


What is parse method in c#?

462






What do you mean by “finalize” and “finally” methods in c#?

490


What is difference between array and arraylist c#?

466


Explain constructor in c#?

693


What's the c# syntax to catch any possible exception?

495


Are multiple data types stored in System.Array?

659


What language do desktop applications use?

482


Explain the 3 types of properties in c# with an example?

551


What debugging tools come with the .NET ssSDK?

702


What are interfaces in c#?

520


What is use of hashtable in c#?

487