Error handling and how this is done ?

Answer Posted / senthil kumar

Error handling is the display the unknown error during the
runtime.here we can use the exception to handle the
error.we also have tje throw exception but its very
difficult to predict the place to identify the error.

try
{
//set of processing code
}
catch(Exception e)
{
Console.WriteLine("Error:"+e.Message);
}
finaly
{
Console.WriteLine("Example Program for the Error
Handling");
}

here set of codes will be executed if any error has found
it will throw the exception from catch block.But finally
will executed compulsarily whether error occured or not
event if you teriminate the control outside from block.

Is This Answer Correct ?    4 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why use a singleton instead of static methods?

533


Is array immutable in c#?

553


What is system predicate?

548


What is mvc firstordefault?

558


What is default access specifier for class in c#?

563






Can abstract class have constructor c#?

540


What is a hash table in c#?

605


What is COM Interoperability?

644


Which is better python or c#?

545


Tell me the difference between value passing and address passing?

744


Is multilevel inheritance possible in c#?

553


How to find Percentage, name ,College from a resume or document ? How to export these values to other page in C#?

606


What is a cs file?

621


What is the purpose of dictionary in c#?

541


What are interfaces in c#?

611