This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
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

Win a copy of Java 8 in Action this week in the Java 8 forum!
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: 6657

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
Similar Threads
Thread/ Runnable
How to kill a user thread forcefully?
Local Variable