DEVFYI - Developer Resource - FYI

What is the difference between yielding and sleeping?

Java Interview Questions and Answers (part 1)


(Continued from previous question...)

41. What is the difference between yielding and sleeping?

When a task invokes its yield() method, it returns to the ready state. When a task invokes its sleep() method, it returns to the waiting state.

(Continued on next question...)

Other Interview Questions