File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Marcus Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Marcus" Watch "Marcus" New topic


Vivek Shrivastava
Ranch Hand

Joined: Jun 03, 2000
Posts: 277

This question is from marcus exam.
Question 44)
Given a reference called
to to a class which extends Thread, which of the following will cause it to give up cycles to allow another thread to execute.
1) t.yield();
2) yield()
3) yield(100) //Or some other suitable amount in milliseconds
4) yield(t);

given answer is �2� but what is wrong with �1�. I have tried following example and it is working fine.
ublic class Test extends Thread{
static Test t;
public static void main(String arg[]){
t = new Test();

public void run(){


please help me.
Ranch Hand

Joined: May 26, 2002
Posts: 79
I agree with u.
Jim Yingst

Joined: Jan 30, 2000
Posts: 18671
Yup. This was brought up some time ago in Mock Exam Errata, which is a good thing to search for stuff like this. Unfortunately it looks to me like Marcus never got around to updating this question, as the question is still the same as it was when the problem was first reported. Maybe we can attract his attention again this time.

"I'm not back." - Bill Harding, Twister
I agree. Here's the link:
subject: Marcus
jQuery in Action, 3rd edition