newbie's question about thread function

From: Hardy (yhang_wang_at_hotmail.com)
Date: 06/25/04


Date: Fri, 25 Jun 2004 16:36:29 +0800

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:)



Relevant Pages

  • who can explain this question for me? Thread method
    ... there's a certification question like below, ... A.calling the yield method ... C.calling the notify method on an object ... executing thread object to temporarily pause and allow other threads to ...
    (comp.lang.java.programmer)
  • Re: who can explain this question for me? Thread method
    ... I think the yield should not be selected. ... > there's a certification question like below, ... > C.calling the notify method on an object ... > executing thread object to temporarily pause and allow other threads to ...
    (comp.lang.java.programmer)
  • Re: newbies question about thread function
    ... I think the yield should not be selected. ... > there's a certification question like below, ... > C.calling the notify method on an object ... > executing thread object to temporarily pause and allow other threads to ...
    (comp.lang.java.help)
  • Re: newbies question about thread function
    ... >> A.calling the yield method ... "This method causes the current thread to yield, ... >> executing thread object to temporarily pause and allow other threads to ... Except that notify must be called from a synchronized context. ...
    (comp.lang.java.help)