What is difference between wait and sleep methods in java? - Java Interview Questions & Answers

What is difference between wait and sleep methods in java? - Java Interview Questions & Answers

瀏覽:1442
日期:2025-06-15
Answer: sleep(): It is a static method on Thread class. It makes the current thread into the "Not Runnable" state for specified amount of time. During this time, the thread keeps the lock (monitors) it has acquired. wait(): It is a method on Object class....看更多