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(), and notifyAll() methods must be executed in synchronized code. C The notify() and notifyAll() methods can be used to signal and move waiting threads to ready-to-run state. D The Thread class is an abstract class. The answer is b c , but I think A is also correct!
the wait() method does make a thread in a Running state to become Not Runnable ... but note that the option says
The wait method defined in the Thread class
i guess the option is false because the wait() method is part of the class Object and only inherited in the Thread class hope that helps Samith.P.Nambiar <pre> \```/ (o o) harder u try luckier u get -------oOO--(_)--OOo---------------------------- </pre>
Why C is correct? I think it's wrong. C The notify() and notifyAll() methods can be used to signal and move waiting threads to ready-to-run state. notify() and notifyAll() methods can signal and move waiting threads to seeking lock state, but not ready-to-run state.
asp3000 , Welcome to javaranch. PROPER NAMES ARE NOW REQUIRED Please look carefully at official naming policy at javaranch & reregister yourself with proper first & last name. Please adhere to official naming policy & help maintain the decorum of the forum. Waiting for your posts with proper first & last name. Once you have reregister , please let us know about that & then your previous account will be disabled. Regards.