Name
ThreadDeath
Synopsis
Signals that a thread should terminate.
This error is thrown in a thread when the Thread.stop(
)
method is called for that thread. This is an unusual
Error
type that simply causes a thread to be
terminated, but does not print an error message or cause the
interpreter to exit. You can catch ThreadDeath
errors to do any necessary cleanup for a thread, but if you do, you
must rethrow the error so that the thread actually terminates.
Figure 10-64. java.lang.ThreadDeath
public class ThreadDeath extends Error { // Public Constructors public ThreadDeath( ); }
Get Java in a Nutshell, 5th Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.