Error handling and how this is done ?

Answers were Sorted based on User's Feedback



Error handling and how this is done ?..

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

Error handling and how this is done ?..

Answer / kishore anumala

Error handling is the Main concept of debugging.
This can be done by creating the log files when an
exception is occurred to trace the error where exactly it
occurred..

Example:

try
{
Your code;
}
catch(exception e)
{
Here you can log the error by using object e;
}

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More C Sharp Interview Questions

Write an expression which satisfies the following statements: (i) Creates an object of type q (ii) If m is null, returns n, otherwise returns m (iii) If x and y are string types, it concatenates x and y

1 Answers  


What is lambda expression in c#?

0 Answers  


What are accessors?

0 Answers  


Can you inherit from a static class in c#?

0 Answers  


how to convert String array to StringBuilder array or vice versa?

3 Answers   Wipro,






What is an arraylist in c#?

0 Answers  


What is ControlBox Propertie

0 Answers   MCN Solutions,


Is stringbuilder thread safe c#?

0 Answers  


Explain the difference between the debug class and trace class?

0 Answers  


How do you implement thread synchronization (object.wait, notify,and criticalsection) in c#?

0 Answers  


What is the difference between disposing of () and finalize() methods in c#?

0 Answers  


What is as keyword in c#?

0 Answers  


Categories