"Exception is a runtime error which arises because of abnormal conditions in a sequence." The exceptions are anomalies that occur during the execution of a program.The System.Exception is the super class of exception. Exception handling is an in built mechanism in .NET framework to detect and handle runtime errors. The .NET framework contains lots of standard exceptions. Exception handling provides uniform, structured and type-safe handling errors. C# provides three keywords try, catch and finally to do exception handling. The try encloses the statements that might throw an exception whereas catch handles exception if one exists. The finally can be used for doing any clean up process. The general form of try-catch-finally in c# is shown below:
try { // Statements which can cause an exception } catch(Type x) { // Statements for handling the exception } finally { // Any Cleanup Code }
This group is an initiative from "Vidya Vrat Agarwal" a .NET Passionate. This group is created with a vision to encourage and help people learn Microsoft .NET technology. This group also provides a platform to share ideas, thoughts and experiences an individual may have while learning and implementing .NET technologies.
1 comment:
"Exception is a runtime error which arises because of abnormal conditions in a sequence."
The exceptions are anomalies that occur during the execution of a program.The System.Exception is the super class of exception.
Exception handling is an in built mechanism in .NET framework to detect and handle runtime errors. The .NET framework contains lots of standard exceptions.
Exception handling provides uniform, structured and type-safe handling errors.
C# provides three keywords try, catch and finally to do exception handling. The try encloses the statements that might throw an exception whereas catch handles exception if one exists. The finally can be used for doing any clean up process.
The general form of try-catch-finally in c# is shown below:
try
{
// Statements which can cause an exception
}
catch(Type x)
{
// Statements for handling the exception
}
finally
{
// Any Cleanup Code
}
Post a Comment