Exception handling

An exception is an event which occurs during program execution and disrupts the normal flow of program instruction i.e. an exception is unwanted situation that disturbs the normal execution of program.

These are run time errors that occur due to abnormal conditions that arise during program execution.

Examples of exception are:

  1. ArrayIndexOutOfBoundException.
  2. ClassNotFoundException.
  3. FileNotFoundException.
  4. IOException.

Exceptions may occur due to the following:

  1. Denominator in a division expression is zero.
  2. Input data is not in desired format.
  3. Wrong array index etc.

If these abnormal conditions are not handled properly the program may terminate or give wrong results or abnormal result.

more on Exception handling:

`

Leave a Reply

Your email address will not be published. Required fields are marked *