I am posting this again
2. Under which circumstances will a
thread stop
A. the method waitforId() in class mediaTracker is called
B. the run() method that the thread is executing ends
C. The call to the start() method of the Thread object returns
D. The suspend() method is called on the Thread object
E. The wait method is called on the Thread object
My understanding
A) I tried to track down the waitForId() method, which calls some other methods, which call some method of the toolkit class,
which are supposed to load the image. So untill the Image is loded the thread waits. If the thread is waiting, then it is not running so it has stopped (running).True.
B)The run method execution ends. The thread stops executing because there is nothing to execute, so it stops ( running).True
C) The start() method doesnt wait for the run method of the new thread to finish execution. start() method returns even if the thread of execution started by it is still executing.False.
D)Suspend Method is called on the new Object.(Do we need to know this for the exam?).By definition suspend Method will stop the thread untill it is resumed. True.
E)Wait method will also stop the thread from running, Untill it is notified by some other thread.True
My choices are not accepted by the Mughal
Test.(It says only b is correct).
I am sure this question has been discussed before, but I still havent come across a definitive answer. Kindly tell me link to some previous discussion of this question.
[This message has been edited by mohit joshi (edited October 06, 2000).]
[This message has been edited by mohit joshi (edited October 07, 2000).]