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 are cshtml files?
Can we inherit two classes in c#?
What is out int in c#?
Explanation on Generic?
What is difference between constants and read-only?
What is int32 maxvalue?
What is a function c#?
What is the difference between User controls and Custom Controls?
Is int a struct in c#?
Can a struct inherit from another struct or class in c#?
What is cosole application?
Differentiate between copy and default constructor.
What are the collection types can be used in c#?
List out two different types of errors in c#?
What are the three types of operators?