Java Partially Checked Exceptions

Checked Exceptions are two types

  • Fully checked exception
  • Partially checked exception

Fully Checked Exception

A checked exception is said to be fully checked if and only if all the child classes also checked.

As shown in the above diagram IOException and SQLException are called Fully Checked Exception, Because all their child classes are also checked exceptions. Other than Throwable, Exception all other child classes of Throwable and Exception (except RuntimeException, Error and their subclasses) are fully checked exception classes.

If we try to catch fully checked exception which would not be raised in try block then we will get compilation error as show in the following example.

Example : catch fully checked exception – which would not be raised in try block

Partially Checked Exception

A checked exception is said to be Partially checked if it has both checked and unchecked child classes.

As shown in the above diagram there are just two Partially Checked Exceptions Throwable and Exception.

If we try to catch partially checked exception which would not be raised in try block, it will not show compilation error as shown in the following example.

Example : catch partially checked exception – which would not be raised in try block

Scroll to Top