This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
The interrupted() method is declared as a static method, so calling this method will always return and clear the interrupted status of the current thread, which may be one of any number of threads used by an application.
The isInterrupted() method, on the other hand, is an instance() method, so it will return the interrupted status of the thread instance on which the method was invoked, which may or may not be the same thread as the current thread. Also, in contrast to the interrupted() method, the isInterrupted() method will never clear the interrupted status.
Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life.
Joined: Apr 24, 2004
Thanks a lot for your reply, Still I don't understand what the current thread is since there may be multiple threads executing at the same time... Or to put it otherwise, what would be the point of calling a method on "one of any number of threads used by an application."? Julien.