Which of the following statements is correct regarding sleep() and wait()?

A. Both wait() and sleep() are methods called by thread objects.

B. 'sleep()' is a method called by a thread object; 'wait()' is a method called by a lock object.

C. None of the above statements are correct.

D. 'wait()' is a method called by a thread object; 'sleep()' is a method called by a lock object.

Correct Answer: B. 'sleep()' is a method called by a thread object; 'wait()' is a method called by a lock object.

Understanding sleep() and wait() in Multithreading: Which Statement is Correct?

原文地址: https://www.cveoy.top/t/topic/odUP 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录