What is the difference between checked and unchecked exceptions in Java?
can01 Answered question May 22, 2023
In Java, there are two types of exceptions: checked and unchecked exceptions.
- Checked exceptions are exceptions that must be declared in the method signature. If a checked exception is thrown in a method, the method must either handle the exception or declare it to be thrown.
- Unchecked exceptions are exceptions that do not need to be declared in the method signature. Unchecked exceptions can be thrown by any method, and they do not need to be handled.
can01 Answered question May 22, 2023
