Hi.....
Ques: Hello all of you now i am work in java but i am not understand Which class is the wait() method defined in? please explain and solve below given a problem....
Which class is the wait() method defined in. I get incompatible return type for my thread’s getState( ) method.
Loading

Satyapriya NayakPosted Dec 11, 2011, 12:46 AM
The
wait()method is defined in theObjectclass, which is the ultimate superclass of all others. So theThreadclass and anyRunnableimplementation inherit this method fromObject.The
wait()method is normally called on an object in a multi-threaded program to allow other threads to run. The method should only be called by a thread that has ownership of the object's monitor, which usually means it is in asynchronizedmethod or statement block.Thanks