This week's giveaway is in the EJB and other Java EE Technologies forum. We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line! See this thread for details.
if a thread might need to be killed from another thread, don't use the stop() method, instead, call interrupt() on it. \ if a thread is sleeping and it receives an interrupt() call, it moves immediately into the Ready state, and when it runs, it will execute its InterruptedException handler.
Sam, Thread.interrupted() Thread.isInterrupted() can be used for testing if a thread was err.. interrupt() Please check the API for the difference between them. If a thread is joining, sleeping or waiting and it is interrupted, it would abandon the state and its "InterruptedException" handler would be executed.
SCJP2. Please Indent your code using UBB Code
subject: What does the Thread method interrupt() mean?