Hi ,
Can u tell me why is wait,Notify,Notifyall methods declared in object class only.
Printable View
Hi ,
Can u tell me why is wait,Notify,Notifyall methods declared in object class only.
Because for every class u create in java, the base class is Object..hope u got
Ok thats fine,But why is these methods declared in Object class rather than Thread class.My real question is we r using this methods only in threads not for any other purposes. so Iam still not agreeing to ur answer.
Hi
All those methods uses the lock on the object.locks are acquired and released at the object level.. since Object is the base class for all the classes,those methods are in Object class.. hope u are clear now.