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
ice is for people that are not already cool. Chill with this tiny ad:
a bit of art, as a gift, that will fit in a stocking