|
By: Samit Katiyar - samit_katiyar@rediffmail.com What is the difference between checked and Unchecked Exceptions in Java? 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. Java Exception Hierarchy +--------+ | Object | +--------+ | | +-----------+ | Throwable | +-----------+ / \ / \ +-------+ +-----------+ | Error | | Exception | +-------+ +-----------+ / | \ / | \ \________/ \______/ \ +------------------+ unchecked checked | RuntimeException | +------------------+ / | | \ \_________________/ unchecked Have Java Problem
Java Books
Return to : Java Programming Hints and Tips All the site contents are Copyright © www.sap-img.com
and the content authors. All rights reserved.
|