0% found this document useful (0 votes)
2 views1 page

Hierarchy of Exceptions

The document outlines the Java exception hierarchy, detailing the base class Throwable, which encompasses both exceptions and errors. It distinguishes between checked exceptions, which must be handled at compile-time, and unchecked exceptions, which occur at runtime due to logic errors. Additionally, it lists various types of exceptions and errors, including IOException, SQLException, and NullPointerException.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views1 page

Hierarchy of Exceptions

The document outlines the Java exception hierarchy, detailing the base class Throwable, which encompasses both exceptions and errors. It distinguishes between checked exceptions, which must be handled at compile-time, and unchecked exceptions, which occur at runtime due to logic errors. Additionally, it lists various types of exceptions and errors, including IOException, SQLException, and NullPointerException.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

java.lang.

Throwable

------------------------------------------------------------------------
├── java.lang.Exception (Checked
Exceptions) │
│ ├── java.io.IOException
└── java.lang.Error (Serious Issues)
│ ├── java.sql.SQLException
├── java.lang.StackOverflowError
│ ├── java.lang.InterruptedException
├── java.lang.OutOfMemoryError
│ ├──
java.lang.ClassNotFoundException ├──
java.lang.VirtualMachineError

├── java.lang.AssertionError
├── ...

├── java.lang.RuntimeException
(Unchecked Exceptions)
│ ├──
java.lang.NullPointerException
│ ├──
java.lang.ArrayIndexOutOfBoundsException
│ ├──
java.lang.ArithmeticException
│ ├──
java.lang.NumberFormatException
│ ├──
java.lang.IllegalArgumentException
│ ├── ...

Explanation:
Throwable is the base class for both exceptions and errors.

Exception includes both checked and unchecked exceptions.

RuntimeException is a subclass of Exception and includes unchecked exceptions.

Error represents serious issues that are usually not recoverable.

checked Exceptions :-
Definition: These are exceptions that are checked at compile-time. The compiler
forces the programmer to handle them using try-catch or declare them using throws.

Unchecked Exceptions :-
Definition: These are exceptions that are not checked at compile-time. They occur
at runtime due to programming logic errors.

You might also like