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 are the types of java languages?
What is the current version of java?
Is space a char?
Write an algorithm program in java for the following question.. In a VLSI design techniques,they used rectangles to design circuits. EVery rectangle is to be placed according to x,y coordinates. Check whether or not two rectangles overlap each other. Here overlapping of rectangles is acceptable, if 1) one rectangle intersect with other. 2) one rectangle fully covers other. The time of algorithm should not exceed o(n logn).
When should I use stringbuffer?
What is an image buffer?
What is the different between get and post?
What do bitwise operators do?
How to create a custom exception?
How can we make a class virtual?
What is advantage of java?
What happens if we override only equals?
What is the size of int?
Differentiate between overriding and overloading cases?
Can we override protected method in java?