Hi, This is a question from Jexam: which will definitely stop a thread from executing? 1) stop //true 2)sleep //true 3)suspend //true 4)yield() // given as correct. But,I have choosen as false.since yield() brings the Thread to ready state.And it may or may not stop executing depending on the i/p in Thread Scheduler. Thanks!
I am surprised that 'stop' and 'suspend' are listed as true since these methods are deprecated in Java 1.2. In other mock exams I've taken, the use of deprecated methods was always viewed as an incorrect answer. As for 'yield,' I had thought that the thread would be 'stopped' while the scheduler looks to see if there is another runnable thread to execute. Even tho' the same thread could be chosen to execute, the thread still seems to be stopped while the scheduler does its checking.
If you are using a rototiller, you are doing it wrong. Even on this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss