开发者

What's happens when Java system detects that Exception has been thrown?

开发者 https://www.devze.com 2022-12-24 06:41 出处:网络
开发者_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.

开发者_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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号