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
Is c# a strongly-typed language?
Classes and structs can be declared as static, is this statement true or false?
Can you pass parameters to destructors?
What are the steps for creating clr trigger
State two different types of access modifiers.
Value Type and Reference Type Data type in C#?
What is difference between struct and class in c#?
Why delegates are type safe?
What is option parameter in C#?
How many kinds of elements an array can have?
Do loops c#?
What is the wildcard character in sql?
What is difference between static and constant variable?
Do extension methods have to be static?
What is a hash table in c#?