Objects of type Error are not Exception objects : Exception « Statements « SCJP






Both Exception and Error share a common superclass, Throwable, 
thus both can be thrown using the throw keyword. 

When an Error or a subclass of Error is thrown, it's unchecked. 

public class MainClass {
  public static void main (String [] args) {
    badMethod();
  }
  static void badMethod() {  
    doStuff();
  }
  static void doStuff() {  
    try {
      throw new Error();
    }
    catch(Error me) {
      throw me; 
    }
  }
}








5.11.Exception
5.11.1.All exceptions descend from the java.lang.Throwable superclass
5.11.2.Declaring Exceptions
5.11.3.Java has two kinds of exception: checked and runtime.
5.11.4.Runtime Exceptions descend from RuntimeException class
5.11.5.Objects of type Error are not Exception objects