Javatpoint Logo

why wait,notify are belongs to object class?

By: anilso*** On: Mon Apr 01 23:38:31 IST 2013     Question Reputation0 Answer Reputation0 Quiz Belt Series Points0  0Blank User
why wait,notify,notifyall methods are belongs to object class not thread class?Up0Down

 
not only this but everything belong to object class because object class is the parent class of every class. Image Created0Down

By: [email protected] On: Tue Apr 02 11:07:23 IST 2013 Question Reputation0 Answer Reputation392 Belt Series Points0 392User Image
Are You Satisfied :1Yes6No
 
wait, notify and notifyAll methods works on the object not thread. That is why they are available in the Object class not Thread class.

These methods concerns with the lock, and each object has an inbuilt lock.
Image Created0Down

By: [email protected] On: Tue Apr 02 13:40:48 IST 2013 Question Reputation0 Answer Reputation77 Belt Series Points0 77User Image
Are You Satisfied :3Yes1No