[OCP 17 book] | [OCP 11 book] | [OCA 8 book] [OCP 8 book] [Practice tests book] [Blog] [JavaRanch FAQ] [How To Ask Questions] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Jeanne Boyarsky wrote:A lot of the time you can't do anything about an exception. Suppose the database is down. Does every class in your app REALLY need to throw a SQLException? Instead, an unchecked exception lets you propagate it up to the top level and deal with "something unexpected" just the once.
Runtime exceptions are not checked.Vaibhav G Garg wrote: . . . handle the Runtime (CHECKED) exceptions . . .
Vaibhav G Garg wrote:I am curious to know what is the use of Unchecked Exceptions. These are the exceptions which programmer is not supposed to catch in the code or declare in the method signature...
Then, why these exceptions have been provided in Java??
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Still a beginner at crafting quality coding but have the zeal to learn more. Your help would be appreciated.
My Blog on Learning Analytics
Campbell Ritchie wrote:
Runtime exceptions are not checked.Vaibhav G Garg wrote: . . . handle the Runtime (CHECKED) exceptions . . .
They try their hardest to answer the questions, but come down heavily towards supporting checked Exceptions.Winston Gutkowski wrote: . . . read the tutorials ... although even they might not answer all your "why" questions.
Winston
manish ghildiyal wrote:My understanding of unchecked exceptions is that it informs that there is some thing fatally wrong with code which needs to be taken care of. Checked exceptions, on other hand, represent those scenarios where user may have provided some wrong data,like non-existing file, and hence killing a program due to wrong user input doesn't make sense.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here