Java: yield() x sleep()

Community ForumCategory: JavaJava: yield() x sleep()
matheusdba Staff asked 2 weeks ago

What is the difference between yield() and sleep() methods?

1 Answers
matheusdba Staff answered 2 weeks ago

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.