interrupted() is a static method of
Thread class. interrupted() checks whether the currently executing thread is interrupted or not. When you say t.check(), you are calling interrupted()
from within the context of the main thread. Thus you are checking whether the
main thread has been interrupted or not.
If you replace interrupted() with isInterrupted(), it should print out true & work as you expected, since isInterrupted() is an instance method.
interrupted() should generally be called from within the run() method of a thread. It checks whether the currently executing thread has been interrupted or not, and it immediately clears the interrupted status flag of the thread. An example of this would be:
Hope that helps!
[This message has been edited by Junaid Bhatra (edited February 11, 2001).]