Knowee
Questions
Features
Study Tools

Select the correct answerWhich 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?OptionsnotifyAll()notify()wait()sleep()

Question

Select the correct answerWhich 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?OptionsnotifyAll()notify()wait()sleep()

🧐 Not the exact question you are looking for?Go ask a question

Solution

The correct answer is wait(). This 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.

Similar Questions

Select the correct answerWhich of these method wakes up the first thread that called wait()?Optionsstart()notify()wake()notifyAll()

Select the correct answerWhich of the following will ensure the thread will be in running state?Optionsyield()wait()Thread.killThread()notify()

Select the correct answerWhich of this method is used to find out that a thread is still running or not?Optionsrun()isAlive()checkRun()Alive()

Select the correct answerWhich of these method of Thread class is used to Suspend a thread for a period of time?Optionssuspend()terminate()sleep()stop()

A monitor called mon has 5 threads in its waiting pool; all these waiting threads have the same priority. One of the threads is thread1. How can you notify thread1 so that it alone moves from Waiting state to Ready State?AExecute notify(thread1); from within synchronized code of monBExecute mon.notify(thread1); from synchronized code of any object.CExecute thread1.notify(); from synchronized code of any object.DExecute thread1.notify(); from any code(synchronized or not) of any object.EYou cannot specify which thread will get notified.

1/3

Upgrade your grade with Knowee

Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.