Exception Handling
Exception Handling
28-11-2014
10/29/202 ANKIT VERMA 57
0
Exception Handling
Exception Example:
Arithmetic Exception
OverFlow Exception
NullReference Exception
10/29/202 58
0
Exception Handling Steps
10/29/202 59
0
Need Of Exception Handling
10/29/202
0
Exception Handling Blocks
Try…………….. Catch…………….. Finally
Try
Try Block contain anticipating code which may raise exception.
Try keyword tell compiler that we want to handle
area of events.
Catch
Catch Block is handler to catch the exception.
Catch block tells application what to do if an error occurs.
Finally
Finally Block is optional.
Finally keyword will occur regardless if the Try-Catch worked
successfully or not.
10/29/202
0
Program Syntax
Syntax:
Try
<statement>
Catch Ex as Exception
<statement>
End Try
10/29/202
0
Program
Progra Outpu
m t
10/29/202
0
Program
Progra Outpu
m t
10/29/202
0