DEVFYI - Developer Resource - FYI

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

Java Interview Questions and Answers (part 2)


(Continued from previous question...)

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

A thread can enter the waiting state by invoking its sleep() method, by blocking on I/O, 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.

(Continued on next question...)

Other Interview Questions