Exception types

Exception is an event that causes the causes application to stop.

Most of them assume they are only two types exceptions but it's three.

1. Checked Exceptions > These are well defined exceptional conditions that application must handle them like FileNotFoundException. When ever we work with Input/output stream classes
compiler force us to handle file not found exception.

2. Errors > These are exceptional conditions that are related external to the application like trying to initialize the thousands of objects in for loop that causes java.lang.OutOfMemoryError.

3. Runtime Exceptions > These are exceptional conditions that are related internal to the application like trying to apply to string operation on null object causing NullPointerException. In general runtime errors are API erorrs.

Ex. String test=null;
System.out.println(test.toString());

All the Runtime exceptions are subclass of RuntimeException class.

Both Errors and RuntimeExceptions are called CheckedExceptions.