Understanding sleep() and wait() in Multithreading: Which Statement is Correct?
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.
原文地址: https://www.cveoy.top/t/topic/odUP 著作权归作者所有。请勿转载和采集!