Our social:

Wednesday, 23 March 2016

Exception Handling in Java

                                 Exception Handling Part1

An unexcepted unwantaed event that disturbs the normal excution flow of a program is called Exception...

EX--TyrePuncturdeException during travelling, SleepingException during class, FileNotFoundException while file reading...e.t.c

->It is highly recommended to handle exception
The main objective of Exception handling is gracefull or normal termination of program...

To defining an alternative way to continue rest of the program normally while exception comes is the concept of Exception Handling.

Exception handling dosent mean reparing an exception, here we have to provide alternative way to continue rest of the program normally is the concept of Exception Handling.

For example:
our programming requirment is to read data from remote file locating at london at runtime if london file is not available our program should not be terminated abnormally..we have to provide some local file to continue rest of the program normally..this way of defining alternative is nothing but exception handling.

 try{
//Read data from Remote File
//Locating at london
    }catch(FileNotFoundException e){
//use local file & continue
//rest of the program normally
               }

                                                                                              Thank you(Smartyy Sunny)

0 comments:

Post a Comment