Interview Questions

Does thread leaves object lock when sleep() method is called?

Java Interview Questions and Answers (part 4)


(Continued from previous question...)

35. Does thread leaves object lock when sleep() method is called?

When sleep() method is called Thread does not leaves object lock and goes from running to waiting state. Thread waits for sleep time to over and once sleep time is up it goes from waiting to runnable state.

(Continued on next question...)

Other Interview Questions