tags:

views:

102

answers:

6

is exception a subclass of error?

+8  A: 

No

java.lang
Class Exception

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception

http://download.oracle.com/javase/1.4.2/docs/api/java/lang/Exception.html

NawaMan
+4  A: 

It's easy to check: Exception extends Throwable, and also Error extends Throwable. So the answer to your question is - no.

duduamar
A: 

No. See apidoc of Throwable.

pcjuzer
+3  A: 
Molske
+1 for totally unnecessary but pretty diagram.
Justin K
+1  A: 

No. Exception and Error are both subclasses of Throwable.

dpatch
+3  A: 

No. Exception and Error both Subclass Throwable. The difference is that an Error represents such a fatal crash that a program should not even try and catch it. Exceptions should be caught and handled.

Stephen