What are the two types of Exceptions in Java? Which are the differences between them?

Technology CommunityCategory: JavaWhat are the two types of Exceptions in Java? Which are the differences between them?
VietMX Staff asked 3 years ago

Java has two types of exceptions: checked exceptions and unchecked exceptions.

  1. Unchecked exceptions do not need to be declared in a method or a constructor’s throws clause, if they can be thrown by the execution of the method or the constructor, and propagate outside the method or constructor boundary.
  2. On the other hand, checked exceptions must be declared in a method or a constructor’s throws clause.