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
Difference between abstract classes and interfaces
What do u mean by delegation?
What is an indexer in c#?
Is type nullable c#?
Why do I get an error (cs1006) when trying to declare a method without specifying a return type?
What are abstract classes in c#?
What is a nullreferenceexception?
You are creating a custom usercontrol, some of the newly created properties are shown in the properties window. How you can hide a new property named theme from the properties window?
Contrast between an interface and abstract class?
Can we inherit a class with private constructor in c#?
What does string format do?
What do u meant by "SBI" of an object?
What is difference between internal and protected internal in c#?
What is the difference between struct and class c#?
How can you access a private method of a class?