Exceptions:-
Class related to " System.Exception" Namespace. it is predefined because System does not class so exception class required.
Exceptions provided run-time error.it is base class error. it is mechanism to solve run-time error.C# is manage to exception error.
Exceptions provide a way to transfer control of a part of a program to another. C + + exception handling is based on three keywords: try, catch, and throw.
- Throw: A program throws an exception when a problem occurs. This is done using a keyword throw.
- Catch: A program detects an exception with an exception handler in place in a program where you want to handle the problem. The keyword indicates catch catch exception.
- try: A try block identifies a block of code for which special exceptions are enabled. It is followed by one or more catch blocks.
You can list multiple catch statements to catch different types of exceptions in case your try block throws an exception over in different situations below.
0 comments:
Post a Comment