Tell me something about Exceptions. What is the common
exception class?
Answer Posted / tiger kumar
Exception is used to handle the errors during the runtime of
the process.It has the three parts.Try,Catch,Finally.The try
is the part of the set of code.Whenever the errors occur in
the Try block it comeout from the try block and the catch
block handles exception class the error.
Finally is little differ from the catch.Because Finally is
must executable part whether it has error or not.
Mostly which is used for close the objects.
try
{
int i =10;
int sum =i/0;
Response.Write("sum is:"+sum);
}
catch(Exception oEx)
{
Response.Write("Error:"+oEx.ToString());
}
catch(DivideByZeroException oEx1)
{
Response.Write("Error:"+oEx1.ToString());
}
Is This Answer Correct ? | 3 Yes | 1 No |
Post New Answer View All Answers
What is lazy keyword in c#?
Define an escape sequence, name few strings in escape sequence?
What is autopostback in c#?
What is the difference between a variable and a literal?
Why dependency injection is used in c#?
What is difference between out and ref in c#?
What are abstract classes in c#?
What is a cs file?
What is the purpose of dependency injection?
What is hashtable c#?
What are the benefits of using generics in c#?
Can datetime be null c#?
What are the features of c#?
Name the two classes are required for implementing a windows service?
What is the symbol used for in c#?