Exceptions, Generics
Exceptions
Throwable
Throwable has two subclasses: Exception and Error.
Error class represents serious errors, which are generally not recommended to be caught by catch in our programs. We can only optimize Errors by optimizing the code. When an Error occurs, JVM generally chooses to terminate the thread.
Exception class has two subclasses: Checked Exception and Unchecked Exception.
Checked Exception means that the exception will be checked at compile time. If the exception is not caught by catch or not throws, it will not pass compilation. This includes IOException, ClassNotFoundException.
Unchecked Exception means that it will not be checked at compile time. It includes RuntimeException and its subclasses, such as NullPointerException, ArrayIndexOutOfBoundsException, and ClassCastException that may occur during forced type conversion.

