plese guys explain me these three key methods supported by Object class....
kind regards.
dmjpro.
Those three methods are the cornerstones of multi threaded programming;
whenever you synchronize on an object (either explicitly or implicitly on this),
the thread obtains ownership on the lock for that object. When you wait, you
release the lock and simply wait. When another thread obtains ownership
on the lock of that object it can notify a waiting thread or it can notify all the
waiting threads. Those threads wake up, check whether or not they can
continue whatever they want to do, and either wait again or release their
ownership on the lock and wait again. The language keyword 'synchronized'
obtains ownership on the lock; leaving the synchronized block/method,
releases the ownership again.
kind regards,
Jos