H
Hardy
there's a certification question like below, the answer is A&E.
which two cannot directly cause a thread to stop executing?
A.calling the yield method
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 start method on another thread object
the api book says: yield public static void yield()Causes the currently
executing thread object to temporarily pause and allow other threads to
execute.
then why A should be selected?
And how about the notify* method? can it DIRECTLY cause a thread to stop
executing?
thanks
which two cannot directly cause a thread to stop executing?
A.calling the yield method
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 start method on another thread object
the api book says: yield public static void yield()Causes the currently
executing thread object to temporarily pause and allow other threads to
execute.
then why A should be selected?
And how about the notify* method? can it DIRECTLY cause a thread to stop
executing?
thanks