Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

thread  RSS feed

 
sri jaisi
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
we use wait.notify,notifyall in threads.but why we have these three methods in object class rather than in thread class

thankz
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Every object has a lock of its own. When you say wait() you want that object's lock and thats why the methods are defined in the Object class.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!