A Try Catch in .Net or any programming language main purpose is to handle the exceptions in a structured manner.
Try
{
// We write the code to be executed
}
Catch(Exception Ex)
{
// To Handle the error
}
Catch(Exception Ex)
{
// To Handle Multiple exceptions of different types
}
If any error got handled then the execution exists or checks the next exception in nested block or also Nested Error ExceptionHandling
Exception is the base Class for ExceptionHandling .For custom Exception handling in the application we need to inherit from BaseClass i.e., Exception
Examples : IndexOutOfRangeException
InvalidCastException
ArgumentOutOfRangeException
NullReferenceException
Interviews2 answers
What is Try-Catch in .net?
2 Answers
Sriram DPosted Jul 19, 2010, 2:00 PM EDT
Static class contain only static members(like variables,methods) on it.
Veerareddy pallelaPosted Jul 18, 2010, 8:45 PM EDT