Hi,all,here are two questions about stop
thread,
[Q1]Which two can directly cause a thread to stop executing? (Choose Two)
A. Exiting from a synchronized block.
B. Calling the wait method on an object.
C. Calling the notify method on an object.
D. Calling the notifyAll method on an object.
E. Calling the setPriority method on a thread object.
choose BE
"Stop" here means blocked, right? B is correct.
What about setPriority happend on stoping action???
[Q2]
Which two CANNOT directly cause a thread to stop executing? (Choose Two)
A.Calling the yield method
B.Calling the wait method on an object
C.Calling the notify method on an object
D.Calling the Notify All method on an object
E.Calling the start method on another Thread object
choose A.E
Yield method causes the thread from running to ready.
E is nothing to do to stop currect thread executing.
Who give me a clear about BCD for this question?
Thanks a lot,
Roger