top of page

Exceptions in Java (1) - Difference Between Error and Exception


An exception is an event that disrupts the normal flow of the program.

 

Difference between Error and Exception

 

There are two types of Exception, built-in Exception and user-defined Exception.

The followings are the some of built-in Exception:

1. Arithmetic Exception

2. ArrayIndexOutOfBound Exception

3. ClassNotFound Exception

4. FileNotFound Exception

5. IO Exception

6. Interrupted Exception

7. NullPointer Exception

8. NumberFormat Exception

9. Runtime Exception


Or you may define your own exception as following:

 

There are two types in built-in Exception.

  1. Checked Exception

  2. Unchecked Exception

1. Checked Exception

It is an exception that occurs at the compile time, also called compile time exceptions.


2. Unchecked Exception

It is an exception that that occurs at the time of execution. These are also called Runtime Exceptions.

 

Kommentarer


Single post: Blog_Single_Post_Widget
bottom of page