File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Difference beteween interrupted() and isInterrupted()

 
ram gaurav
Ranch Hand
Posts: 208
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI

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

Thanks
Regards
Gaurav
 
Keith Lynn
Ranch Hand
Posts: 2399
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2023
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See this thread
 
Barry Gaunt
Ranch Hand
Posts: 7729
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
ram gaurav
Ranch Hand
Posts: 208
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot to you all.
Now i am clear about that.

Thanks
Gaurav
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic