wait(),notify() and notifyAll() are in Object class
HI , I have some doubt regarding on Multithreading in java.why wait() , notify() and notifyAll() methods are in Object class not in Thread class.Can anybody please try to explain me why this type of implementations have done?
These methods deal with locks, not threads, and any object can serve as a lock. If you were to ever use them for real, you'd see that they HAVE to be on Object.
jverda at 2007-7-12 19:18:47 >
