Unchecked Exception | Checked Exception |
All the subclasses of RuntimeException are called unchecked exception. | All subclasses of Throwable class except RuntimeException are called as checked exceptions |
Unchecked exceptions need not be handled at compile time as These exceptions arise mostly due to coding mistakes in our program. | Checked Exceptions need to be handled at compile time. |
Here, the JVM does not require the exception to catch and handle. | Here, the JVM needs the exception to catch and handle. |
Example-ArrayIndexOutOfBoundsException, ClassCastException, IndexOutOfBoundException | SqlException, FileNotFoundException,ClassNotFoundException |
Differences between checked and Unchecked exceptions in java?
by
Tags:
Leave a Reply