could any one tell me that why the 3 overloaded form of wait method and notify, notifyAll are in object class insted of thread class?
Object v/s Thread
Collapse
X
-
Tags: None
-
Regarding the wait, from the docsOriginally posted by theneoendersoncould any one tell me that why the 3 overloaded form of wait method and notify, notifyAll are in object class insted of thread class?
"A thread waits on an object's monitor by calling one of the wait methods."
"This method should only be called by a thread that is the owner of this object's monitor."
Similar descriptions hold for the other methods.
These methods therefore have to be in Object since an Object is the monitor for a thread.
Comment