File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Mock Exam Errata and the fly likes yield Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Professional Certification » Mock Exam Errata
Reply Bookmark "yield" Watch "yield" New topic
Author

yield

Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
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!

Louise Haydu
Ranch Hand

Joined: Aug 17, 2000
Posts: 51
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.
 
 
subject: yield
 
Threads others viewed
Thread Q from jexam
Thread Question
Q on thread at Jxam
yield
Thread Question
developer file tools

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture