Home » JAVA Programming » Multithreading » Question
  1. Which of these method is used to tell the calling thread to give up a monitor and go to sleep until some other thread enters the same monitor?
    1. sleep()
    2. notifyAll()
    3. wait()
    4. notify()
    5. None of these
Correct Option: C

wait() method is used to tell the calling thread to give up a monitor and go to sleep until some other thread enters the same monitor. This helps in avoiding polling and minimizes CPU idle time.



Your comments will be displayed only after manual approval.