...

/

Understanding Different Types of Exceptions

Understanding Different Types of Exceptions

In this lesson, we'll walk through different types of exceptions.

Types of exceptions

All exceptions come under a parent class, named Exception class.

The exceptions are categorized into two types:

  • Checked exceptions
  • Unchecked exceptions

Checked exceptions

These exceptions are checked by the compiler during compilation. Therefore, they are also known as compile-time exceptions.

These exceptions must be handled or declared.

Some common checked exceptions are:

IOException

This exception is thrown when there is a problem regarding reading and writing files.

 ...