Working on exception handling :

imaginor-labs 15 June 19
Technology Comments

Error Handling increase the flexibility of the program without getting to exit abruptly . Handling exception at runtime is very important . Lets check out with few examples .

imag1

If you don't know the type of exceptions that a code block can possibly raise, you can use Exception which catches all exceptions. In addition, you can have multiple except statements .

imag2

Try except can also be used outside the scope :

imag3

Try-finally :
The finally clause in the try block is a optional to catch any exception which you have missed , which will automatically fall in the finally block .

imag4

So here are the few example of handling exception .

Happy learning and sharing !!

Comments:

Add a Comment:



Recent Posts: