简体   繁体   中英

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

ait(如标题所示);

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM