• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Exception

 
Gaurav Pavan Kumar Jain
Ranch Hand
Posts: 168
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Folks

What is the main difference between Exception and Error?

 
Chandra Bhatt
Ranch Hand
Posts: 1710
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
thanks buddy
 
Sourin K. Sen
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • 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.
 
Milan Jagatiya
Ranch Hand
Posts: 164
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yeahh... Sourin is correct...

[ April 11, 2007: Message edited by: Milan Jagatiya ]
 
Stuart Ash
Ranch Hand
Posts: 637
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This explanation should help:

Error, Exception, etc.
 
Chandra Bhatt
Ranch Hand
Posts: 1710
  • Mark post as helpful
  • send pies
  • 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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic