File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes thread Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "thread" Watch "thread" New topic


sri jaisi

Joined: Sep 02, 2006
Posts: 23
we use wait.notify,notifyall in threads.but why we have these three methods in object class rather than in thread class

Deepak Bala

Joined: Feb 24, 2006
Posts: 6662

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.

SCJP 6 articles - SCJP 5/6 mock exams - More SCJP Mocks
I agree. Here's the link:
subject: thread
It's not a secret anymore!