As shown below, interrupted () alters the interrupt state (purge) of the thread, while isinterrupted () does not affect the interrupt state of the thread
1 /*** Tests whether the current thread has been interrupted. the
* <i>interrupted status</i>of the thread is cleared by this method. Inch
* Other words, if this method were to being called twice in succession, the
* Second call would return False (unless the current thread were
* Interrupted again, after the first call had cleared its interrupted
* Status and before the second call had examined it).
* * <p>a thread interruption ignored because A thread is not alive
* At the time of the interrupt would be reflected by this method
* Returning false.
* * @return<code>true</code> If the current thread has been interrupted;
* <code>false</code> otherwise. * @see#isInterrupted () * @revised 6.0*/
Public Static Booleaninterrupted () {2 returnCurrentThread (). isinterrupted (true);3 }4 5 6 /*** Tests Whether this thread has been interrupted. The <i>interrupted
* status</i> of the thread is unaffected by this method.
* * <p>a thread interruption ignored because A thread is not alive
* At the time of the interrupt would be reflected by this method
* Returning false. * * @return<code>true</code> If this thread has been interrupted;
* <code>false</code> otherwise. * @see#interrupted () * @revised 6.0*/
Public BooleanIsinterrupted ()
{returnIsinterrupted (false);}7 8 9 Ten /*** Tests If some Thread has been interrupted. The interrupted state
* is reset or not based on the value of clearinterrupted that is * passed. */
Private native BooleanIsinterrupted (Booleanclearinterrupted);
The difference between the interrupted method and the Isinterrupted method of the thread class