What are the differences between unchecked exception, checked exception, and errors?
Answers were Sorted based on User's Feedback
Answer / nashiinformaticssolutions
• 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 |
• 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 |
write SQL command for table employee where print first name or last name start like "A" and who is working in domain(angular js,java,dotnet)
why interaction with server using javascript is difficult
What is the base class of all exception classes?
What are some examples of variable costs?
What is void data type?
what do you mean by java annotations?
Write a code to show a static variable?
What class allows you to read objects directly from a stream in java programming?
does java support pointers?
What are "methods" and "fields"?
How many JVMs can run on a single machine and what is the Just-In-Time(JIT) compiler?
Difference between class#getinstance() and new operator ?