wood burning stoves 2.0*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Exception" Watch "Exception" New topic
Author

Exception

Gaurav Pavan Kumar Jain
Ranch Hand

Joined: Mar 19, 2007
Posts: 168
Hi Folks

What is the main difference between Exception and Error?

Chandra Bhatt
Ranch Hand

Joined: Feb 28, 2007
Posts: 1707


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 ]

cmbhatt
Gaurav Pavan Kumar Jain
Ranch Hand

Joined: Mar 19, 2007
Posts: 168
thanks buddy
Sourin K. Sen
Ranch Hand

Joined: May 02, 2006
Posts: 86
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.


Regards,<br />Sourin.
Milan Jagatiya
Ranch Hand

Joined: Jan 01, 2007
Posts: 164
yeahh... Sourin is correct...

[ April 11, 2007: Message edited by: Milan Jagatiya ]

Milan.<br />I can because I think I can...
Stuart Ash
Ranch Hand

Joined: Oct 07, 2005
Posts: 637
This explanation should help:

Error, Exception, etc.


ASCII silly question, Get a silly ANSI.
Chandra Bhatt
Ranch Hand

Joined: Feb 28, 2007
Posts: 1707
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 ]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Exception
 
Similar Threads
WA #1.....word association
counting algorithm
void return type in JSP expression
why JMX can not stop
Java ranch rules roundup