Which of the following statements are true with regards to the different thread states in Java?

1. The wait(), notify(), and notifyAll() methods 
   must be executed in synchronized code.
2. The wait method defined in the Thread class, 
   can be used to convert a thread from Running state 
   to Waiting state.
3. The notify() and notifyAll() methods can be used 
   to signal and move waiting threads to ready-to-run state.
4. The Thread class is an abstract class.

Of the statements above, only the first three statements are true. The fourth statement is not true – the Thread class is not abstract.

Hiring? Job Hunting? Post a JOB or your RESUME on our JOB BOARD >>

Subscribe to our newsletter for more free interview questions.

  • Rohit

    wait, notify method belongs to Object class

  • Iftikhar Ahmed Khan

    Methods inherited from class java.lang.Objectequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

  • Rohit Kumar Tiwari

    The wait method defined in the Thread class,
    can be used to convert a thread from Running state
    to Waiting state.

    This is wrong statement wait() method belongs to the Object class.

  • Debajit

    wait is not a method of class thread. It belongs to Object class.