| What do you mean by checked and unchecked exception in Java?
Below is the main difference between checked and unchecked exception in Java.
(1)Checked exception:-Checked exception is checked by compiler at compile time. And it is mandatory for any method to either handle checked exception or we can declare them in throws clause. These are the ones which are a subclass of Exception but doesn’t descend from RuntimeException.
(2)unchecked exception:-When we say about unchecked exception it is descendant of RuntimeException and not checked by the compiler at compile time. | | |