• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Devaka Cooray
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Saloon Keepers:
  • Tim Holloway
Bartenders:

Exception

 
Ranch Hand
Posts: 168
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Folks

What is the main difference between Exception and Error?

 
Ranch Hand
Posts: 1710
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


If you catch the Throwable, Error or Exception you need not to throw them
in the try block.

If you catch subclasses of Exception or Throwable, you must throw it in the try block!

Regards,
cmbhatt
[ April 15, 2007: Message edited by: Chandra Bhatt ]
 
Gaurav Pavan Kumar Jain
Ranch Hand
Posts: 168
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks buddy
 
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Chandra Bhatt:
[QB]Throwable (Daddy of all exceptions)
^
|
|
Error
^
|
|
Exception



Hi Bhatt,

Dont you think this is misleading cause exceptions dont extend from errors & neither do errors extend from exceptions. They both extend from throwable alright but they are actually 2 different branches.

It appears from your diagram that exceptions extend from errors.
 
Ranch Hand
Posts: 164
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yeahh... Sourin is correct...

[ April 11, 2007: Message edited by: Milan Jagatiya ]
 
Ranch Hand
Posts: 637
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This explanation should help:

Error, Exception, etc.
 
Chandra Bhatt
Ranch Hand
Posts: 1710
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Extremely sorry to you all,

Actually I didn't see what exactly went from my clipboard to my post.
You know, less caffeine a day causes this sort of mistakes.



My explanation is correct, I assure. Isn't it?

Thanks for pointing out the blunder!


Regards,
cmbhatt
[ April 11, 2007: Message edited by: Chandra Bhatt ]
 
Nothing? Or something? Like this tiny ad:
Paul Wheaton's 16th Kickstarter: Gardening playing cards for gardeners and homesteaders
https://coderanch.com/t/889615/Paul-Wheaton-Kickstarter-Gardening-playing
reply
    Bookmark Topic Watch Topic
  • New Topic