Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


What are the differences between unchecked exception, checked exception, and errors?

Answers were Sorted based on User's Feedback



What are the differences between unchecked exception, checked exception, and errors?..

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

What are the differences between unchecked exception, checked exception, and errors?..

Answer / 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

More Core Java Interview Questions

Difference between string s= new string (); and string s = "abv";?

0 Answers   Cap Gemini,


How do weakhashmap works?

0 Answers  


why Runnable interface is preferable than extending the Thread class?

7 Answers   Aizza, College School Exams Tests, Sybrant Technologies, Wipro,


Can we use return in constructor?

0 Answers  


When we give defination of interface method in the class why method must be public???

2 Answers  


How you can force the garbage collection?

0 Answers  


How infinite loop is declared?

0 Answers  


what is synchronization and why is it important? : Java thread

0 Answers  


How do you identify independent and dependent variables?

0 Answers  


How to convert a string to long?

2 Answers  


Can a java program have 2 main methods?

0 Answers  


What are passing parameters?

0 Answers  


Categories