Java OCA OCP Practice Question 2205

Question

What can be guaranteed by calling the method yield()?

Select the one correct answer.

  • (a) All lower priority threads will be granted CPU time.
  • (b) The current thread will sleep for some time while some other threads run.
  • (c) The current thread will not continue until other threads have terminated.
  • (d) The thread will wait until it is notified.
  • (e) None of the above.


(e)

Note

The exact behavior of the scheduler is not defined.

There is no guarantee that a call to the yield() method will grant other threads use of the CPU.




PreviousNext

Related