Given a reference called
t
to a class which extends
Thread, which of the following will cause the currently executing Thread to give up cycles to allow another thread to execute.
1) t.yield();
2) Thread.yield();
3) yield(100); //Or some other suitable amount in milliseconds
4) yield(t);
1.I worked on the above program,that showed 1 and 2 answers are correct.But i want to verify the answer since Threads topic is new for me.is that correct answers are 1 and 2.Please let me know.
2.Is yield() is not a guaranted?
[ February 16, 2007: Message edited by: Shiva Mohan ]
[ February 16, 2007: Message edited by: Shiva Mohan ]