Answers

Question and Answer:

  Home  Java Threads

⟩ What are three ways in which a thread can enter the waiting state? Or What are different ways in which a thread can enter the waiting state?

A thread can enter the waiting state by the following ways:

1. Invoking its sleep() method,

2. By blocking on I/O

3. By unsuccessfully attempting to acquire an object's lock

4. By invoking an object's wait() method.

5. It can also enter the waiting state by invoking its (deprecated) suspend() method.

 183 views

More Questions for you: