Showing posts with label Exception handling. Show all posts
Showing posts with label Exception handling. Show all posts

Friday, 22 April 2016

Checked vs. Unchecked exceptions


All predefined exceptions in Java are either a checked exception or an unchecked exception.

Checked exceptions must be caught using try / catch block or we should throw the exception using throws clause.
If you don't, compilation of program will fail.

Object
     |---- Throwable
                   |---- Error       |----- Exception (checked)
                                                             |----- RuntimeException (unchecked)