Dan and I talked about this sentence a few weeks ago.
d. The boolean value false will be returned if Thread.interrupted or Thread.isInterrupted is invoked after the InterruptedException has been thrown.
We experimented with a few other ways to say the same thing. At the time, I think we both liked this alternative.
If the Object.wait method completes abruptly with an InterruptedException, a subsequent call to the Thread.interrupted or Thread.isInterrupted method will return false.
Either way, let�s compare t.interrupt() and Thread.interrupted()
t.interrupt() � sets the interruption status
Thread.interrupted() � tests and clears the interruption status
t.isInterrupted() - tests but does not clear the interruption status
Suppose some thread invokes wait(). The thread is now blocked. Some other thread invokes
t.interrupt(). The VM sets the interruption status to true. The wait() method
clears the interruption status and throws an InterruptedException. The first thread catches the exception and invokes
Thread.interrupted(). Since wait() cleared the interruption status, Thread.interrupted() returns false.
[ July 17, 2003: Message edited by: Marlene Miller ]