aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Difference beteween interrupted() and isInterrupted() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Difference beteween interrupted() and isInterrupted()" Watch "Difference beteween interrupted() and isInterrupted()" New topic
Author

Difference beteween interrupted() and isInterrupted()

ram gaurav
Ranch Hand

Joined: Mar 29, 2006
Posts: 208
HI

Please explain me the basic difference beteween interrupted() and isInterrupted() methord of Thread class.

Thanks
Regards
Gaurav
Keith Lynn
Ranch Hand

Joined: Feb 07, 2005
Posts: 2367
interrupted() is a class method in Thread that determines if the current thread has been interrupted.

isInterrupted() is an instance method that determines if the thread instance that calls it has been interrupted.
wise owen
Ranch Hand

Joined: Feb 02, 2006
Posts: 2023
See this thread
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
Another big difference is that interrupted() tests and clears the interrupted status flag, but isInterrupted() just tests the interrupted status flag leaving the flag in the state it finds it.


Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
ram gaurav
Ranch Hand

Joined: Mar 29, 2006
Posts: 208
Thanks a lot to you all.
Now i am clear about that.

Thanks
Gaurav
 
jQuery in Action, 2nd edition
 
subject: Difference beteween interrupted() and isInterrupted()