Hi, I'll give it my best shot..
After invoking the wait method on an object, obj1, a thread, T1, will remain in the wait set of obj1 until which of the following occurs?
re-worded:
When the tread 'T1' calls the 'wait' method on the object 'obj1', what will bring back the thread from the wait queue ?
Meaning, when in the thread T1 you do obj1.wait, the object obj1 is unlocked and the thread goes in a "wait" queue.
If you want to the thread to continue its execution, you need to notify him.
a. Another thread invokes the notify method on the object, obj1, and T1 is selected to move out of the wait set
b. Another thread invokes the notifyAll method on the object
c. Another thread invokes the resume method on thread T1
d. Another thread interrupts thread T1
e. The priority of thread T1 is increased
f. A specified timeout period has elapsed
g. Another thread invokes the join method on thread T1
A) and B) are correct, if you do a notify, the thread will live again. Note that for answer A, if you remove "...and T1 is selected to move out of the wait set" it is wrong. If you don't do a notifyAll(), but rather notify(), only 1 thread from the wait queue is notified and it might not be the one you think.
D) is good because it will interrupt the thread and cause an interruptedException, so the thread will be running again, but in its catch Exception block.
F) is good because if you specify a timeout, the thread will leave the wait queue after the timeout has expired if no one nofified him before.
bye
Alex
[ May 02, 2005: Message edited by: Alex Turcot ]