From the Marcus Green exam 3:
Given a reference called
t
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) Thread.yield();
3) yield(100); //Or some other suitable amount in milliseconds
4) yield(t);
The answers given are 1 and 2 but I find the question troubling. The question does not state whether t is a reference to the current
thread or another thread so I took it to mean that t could be a reference to another thread. If so, none of the answers are correct.
Perhaps I am missing something but the question seems to be unclear in its intent.
Are we expected to see our way through ambiguously worded questions on the real exam?