Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

wait()

 
sai donthneni
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would like to know whether wait() method belongs to class Thread or it belongs to class object? Since, when wait() is implemented in classes it is just called as wait() and not being called by any object inside a synchronous method.
 
Keith Lynn
Ranch Hand
Posts: 2409
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by sai donthneni:
I would like to know whether wait() method belongs to class Thread or it belongs to class object? Since, when wait() is implemented in classes it is just called as wait() and not being called by any object inside a synchronous method.


Well the wait() method is public in Object which means it is inherited by every class including Thread.

What's important is the thread that calls the wait() method. Whatever thread calls it will place itself into the waiting state.
[ April 10, 2006: Message edited by: Keith Lynn ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic