static interrupted() method returns interrupted flag & sets flag to false if it is true - Core Java

Q.  Which method returns the interrupted flag after that it sets the flag to false if it is true?
- Published on 19 Oct 15

a. isInterrupted()
b. static interrupted()
c. non static interrupted()
d. Both A & C

ANSWER: static interrupted()
 

    Discussion

  • Nirja Shah   -Posted on 20 Aug 15
    A static interrupted() method is used by the thread. This method tests if the thread which is currently executing has been interrupted or not. If it is being interrupted then it clears the interrupted flag in the current thread object and returns the condition to true.

Post your comment / Share knowledge


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)