-
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?
-
- sleep()
- notifyAll()
- wait()
- notify()
- 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.