- The immediate subclass of java.lang.exception class is called checked exception class. This exception is quite serious exception to catch and handle. The sub classes of java.lang.Runtime exception class are called unchecked exception. If a java method throws checked exception we must catch and handle the exception by using try catch blocks or we must declare to exception to be throws by using throws statement while calling that method. If a java method throws unchecked exception catching and handling that exception or declaring the exception to be thrown is always optional work to do. No exception will come at compile time. The compile time error that comes related to checked exception are not exception they are compile time programmatic and syntactical error. It is always recommended to avoid throws class utilization in the process of dealing with exception because it cannot avoid abnormal program termination in application execution. It is always recommended to use try catch block to catch and handle the exception and to avoid abnormal termination of the application execution when exception is raised. While working with java statement which throws checked or unchecked exception it is recommended to catch and handle exception in the entire situation.
Saturday, September 25, 2010
• Checked vs. unchecked exception
Labels:
Difference,
Exceptions
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment