What is the function of yeild() method in Thread class in Java programming language?

Submitted 3 years, 4 months ago
Ticket #318
Views 272
Language/Framework Java
Priority Low
Status Closed

Can someone explain in brief please!!

Submitted on Dec 07, 20
add a comment

1 Answer

Verified

Yeild() method stops a running thread so that other threads which are in the waiting state and are of the same priority as the running thread will get a chance to execute.

There is no guarantee that this will always happen, there is no guarantee that there are other threads of same priority in waiting state.

Submitted 3 years, 4 months ago


Latest Blogs