465
Java Thread yield() method
The yield() method of thread class causes the currently executing thread object to temporarily pause and allow other threads to execute.
Syntax
Return
This method does not return any value.
Example
Output:
main in control main in control main in control Thread-0 in control Thread-0 in control Thread-0 in control Thread-1 in control Thread-1 in control Thread-1 in control
Next TopicMultithreading Java