What's happens when Java system detects that Exception has been thrown?
开发者_C百科a.i.t.(for as in title);
If your application code catches the exception, then execution continues in the body of the catch
clause, and so on.
If your application code does not catch the exception, then one or more of the following things can happen:
If the exception was thrown on the main thread, the JVM will exit.
If the exception was thrown on some other thread, the thread will die.
Either way, if the thread on which the exception was thrown has an "uncaught exception handler", that handler will be called before the thread / JVM exits.
精彩评论