This is regarding question number 37 in the exam at site http://www.javaprepare.com/quests/test.html javaprepare.com - Sample test 1 exam. The question is : Which of the following statements are true. Select all correct answers. (a)The wait method defined in the Thread class, can be used to convert a thread from Running state to Waiting state. (b) The wait(), notify(), notifyAll() must be executed in sybchronized code. (c) The notify() method can be used to signal and move waiting threads to ready-to-run state. (d) The Thread class is an abstract class. Answer at site to this question is b,c . But I have a doubt here. The notify method can be used to signal and move only one(any one out of many if there are many) waiting thread not threads to ready-to-run state. notifyAll() is used to signal and move waiting threads to ready-to-run state. Please clarify !!!
rajsim
Ranch Hand
Joined: May 31, 2000
Posts: 116
posted
0
There are many more errors in the site mentioned by you. Watch out. [This message has been edited by rajsim (edited August 07, 2000).]
Anonymous
Ranch Hand
Joined: Nov 22, 2008
Posts: 18944
posted
0
Can anybody please verify why a is not a right answer? Thanx
Anonymous
Ranch Hand
Joined: Nov 22, 2008
Posts: 18944
posted
0
Why a is not right. Is it bcoz when wait() is applied to a running thread, it goes to ready state not waiting state. Please clarify.
Netla Reddy
Greenhorn
Joined: Jun 18, 2000
Posts: 15
posted
0
Dear All, wait() method is not implimented in the in the thread class, It should implement in the in object class. notify() will move only one thread form waiting to ready and notifyall () will move all waiting threads to Ready state I hope it is clear...... Thanks
[This message has been edited by Netla Reddy (edited September 03, 2000).]