Java OCA OCP Practice Question 81

Question

Which of the following are true?

  • A. The sleep() method puts a thread in the ready state.
  • B. The yield() method puts a thread in the waiting state.
  • C. The suspend() method is the preferred method for stopping a thread's execution.
  • D. A thread's interrupt() method results in the throwing of the InterruptedException.


D.

Note

sleep() method puts threads into sleep.

The interrupt() method results in the throwing of the InterruptedException when an interrupted thread enters the running state.




PreviousNext

Related