[EMAIL PROTECTED] wrote: > I have some questions here: > > (A) If an 'Error' is caught by an application handler > and does not > exit() the program or some other drastic action, I presume that > the application just keeps running. But if it is not > caught, meaning > that none of the methods in the stack have a handler, then it must > be handled by the handler provided by the JVM. At this > point, does > the thread quit, just like an 'Exception' does, or should the JVM > shut down completely?
Except for the finalize() case, any Throwable that is not caught by user code is handled by the VM (i.e. passed to the Thread.UncaughtExceptionHandler or ThreadGroup.uncaughtException() method). > (B) In the API spec 1.5.0, there are only two known > direct subclasses > of java.lang.Throwable. Is there any reason at all to > EVER expect an > application to define some class that is a direct > subclass of java.lang.Throwable > that is, not also a subclass of 'Exception' or 'Error'? This question is not relevant to the VM implementer. Rule 1: Whether there is a reason or not, someone will do it. In any case, the VM doesn't really care about it. In all but one case, the VM only cares about Throwable. The single exception is when an exception (i.e. Throwable) escapes from a static initializer, if the exception is not an Error the VM will wrap the exception in an ExceptionInInitializerError. Regards, Jeroen
