What is the difference between Checked and UnChecked Exception?
==============================================================
-> Checked Exception: The Exceptions which are checked by compiler for smooth execution of the program at runtime are called Checked Exception.
-> Compiler will check whether we are handling checked exceptin or not. If we are not handling then we will get compile time error.
For example: HallTicketMissingException, FileNotFoundException, IOException etc...
-> Unchecked Exception: The Exceptions which are not checked by compiler whether the programmer handling or not are called Unchecked Exception.
RuntimeException and its child classes, Error and its child classes are unchecked except these the remaining are checked exception.
For example: BombBlastException, ArithmeticException, NullPointerException etc...
-> Checked Exception is required to be handled by compile time while Unchecked Exception doesn't.
-> Checked Exception is direct sub-Class of Exception while Unchecked Exception are of RuntimeException and Error.
==============================================================
-> Checked Exception: The Exceptions which are checked by compiler for smooth execution of the program at runtime are called Checked Exception.
-> Compiler will check whether we are handling checked exceptin or not. If we are not handling then we will get compile time error.
For example: HallTicketMissingException, FileNotFoundException, IOException etc...
-> Unchecked Exception: The Exceptions which are not checked by compiler whether the programmer handling or not are called Unchecked Exception.
RuntimeException and its child classes, Error and its child classes are unchecked except these the remaining are checked exception.
For example: BombBlastException, ArithmeticException, NullPointerException etc...
-> Checked Exception is required to be handled by compile time while Unchecked Exception doesn't.
-> Checked Exception is direct sub-Class of Exception while Unchecked Exception are of RuntimeException and Error.
Comments
Post a Comment