Let me conclude
a. Instances of class Thread have a method called notify()
// correct as notify() is inherited by Thread class from Object and all subclasses will have a method called notify.
b. A call to the method notify() will wake the thread that currently owns the monitor of the object
// wrong
Java API specifies - "The awakened thread will not be able to proceed until the current thread relinquishes the lock on this object.
c. The method notify() is synchronized
// wrong notify() is declared as "public final void notify() " thus not synchronized and note that i cannot override it in my subclasses as it is final.
d. The method notifyAll() is defined in class Thread
// wrong declared in Object class
e. When there is more than one thread waiting to obtain monitor of an object, there is no way to be sure which thread will be notified by the notify() method.
// true Java - API says "The awakened thread will compete in the usual manner with any other threads that might be actively competing to synchronize on this object. "
hi Benli Xu,
your doubt on b is not tenable as the awakened thread will not be able to proceed until the current thread relinquishes the lock on this object.
Regds.
Rahul