View Single Post
Old 06-01-2010, 07:09 AM   #44
rajesh
Member
 
rajesh's Avatar
 
Join Date: Dec 2009
Posts: 76
Rep Power: 15
rajesh is on a distinguished road
Default What are Checked and Unchecked Exceptions?

A checked exception is some subclass of Exception (or Exception itself), excluding class RuntimeException and its subclasses. Making an exception checked forces client programmers to deal with the exception may be thrown. Checked exceptions must be caught at compile time. Example: IOException.

Unchecked exceptions are RuntimeException and any of its subclasses. Class Error and its subclasses also are unchecked. With an unchecked exception, however, the compiler doesn’t force client programmers either to catch the exception or declare it in a throws clause. In fact, client programmers may not even know that the exception could be thrown.
Example: ArrayIndexOutOfBoundsException. Errors are often irrecoverable conditions.
rajesh is offline   Reply With Quote