April 2017
Intermediate to advanced
594 pages
25h 15m
English
In the following screenshot, you can see the results of the execution of the example. The exception is thrown and captured by the handler that writes the information about Exception and Thread that threw it. This information is presented in the console:

When an exception is thrown in a thread and remains uncaught (it has to be an unchecked exception), the JVM checks whether the thread has an uncaught exception handler set by the corresponding method. If it does, the JVM invokes this method with the Thread object and Exception as arguments.
If the thread doesn't have an uncaught exception handler, the JVM prints the stack trace ...
Read now
Unlock full access