What are the differences between unchecked exception, checked exception, and errors?
Answer Posted / hr@tgksolutions.com
• An Unchecked exception inherits from RuntimeException (which extends from exception). The JVM treats RuntimeException differently as there is no requirement for the application code to deal with them explicitly.
• A checked exception inherits from the exception class. The client code has to handle the checked exceptions either in a try-catch clause or has to be thrown for the super-class to catch the same. A checked exception thrown by a lower class (sub-class) enforces a contract on the invoking class (super-class) to catch or throw it.
• Errors (members of the error family) usually appear for more serious problems, such as OutOfMemoryError (OOM), that may not be so easy to handle.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What languages are pass by reference?
What do you understand by access specifiers in Java?
Which non-unicode letter characters may be used as the first character of an identifier?
What are JVM.JRE, J2EE, JNI?
Highest level event class of the event-delegation model?
What are the object and class classes used for?
Is 0 true or false?
explain autoboxing in java?
Have you ever used hashtable and dictionary?
What are synchronized methods and synchronized statements in java programming?
What is a "pure virtual" member function?
Can you access non static variable in static context?
Tell us something about different types of casting?
What is string syntax?
Does java have a compiler?