✏️ Explanatory Question

What are the ways in which a thread can enter the waiting state?

👁 4,142 Views
📘 Detailed Answer
💡

Answer with Explanation

A thread can enter the waiting state by invoking its sleep() method, by blocking on IO, by unsuccessfully attempting to acquire an object's lock, or by invoking an object's wait() method. It can also enter the waiting state by invoking its (deprecated) suspend() method.