Search your topic in Java2share
Home > FAQs
eXTReMe Tracker


Exception Handling FAQs


Untitled Document

Q33. What is the difference between Error and Exception?
Ans.  Throwable class contain two child classes.
          Exception:- These are mostly caused by our program and are recoverable.
          Error:- These are not caused by our program, mostly caused by lake of system resources. These are non recoverable.

Q34.  What is difference between checked exception and unchecked exception?
Ans.  The exceptions which are checked by the compiler for smooth execution of the program at Runtime is called checked exception. Example: IOException, InterruptedException.The exceptions which are not checked by the compiler are called unchecked exception. Example: ArithmeticException,RuntimeException.
Q35.What is difference between partially checked and fully checked Exception?
Ans.  A checked exception is said to be fully checked if and only if all the child classes also checked otherwise it is called partially checked exception.
                Example:
 IOException:- fully checked exception
                Exception:- partially checked exception
                Throwable:- partially checked exception
                RuntimeException:- unchecked exception

Q36. What is a customized Exception?
Ans.   Sometimes based on our programming requirement we have to create our own exception such type of exception are called customize Exception.
                Example:
                                TooYoungException
                                TooOldException
                                InsufficientFundException