why Object class have notify,notifyall,wait methods

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tirupati d
    New Member
    • Jul 2011
    • 1

    why Object class have notify,notifyall,wait methods

    Object class have notify, notifyall,wait methods.

    But we never use these methods in other class pakages

    but we use these methods only in Thread classes.
    Java api gave these methods in Object class. Why dont they keep these methods in Thread class...
  • plsHelpMe
    New Member
    • Jan 2008
    • 58

    #2
    Thread communicates by using objects without referencing communicating threads. If these methods are moves to Thread class then each needs a reference to other thread to communicate with it.

    Comment

    Working...