what is the difference between sleep() and Wait()?
Answer Posted / deepak divvela
The main difference is if we need the thread wants to block
particular period of time we just choose sleep().
and when the thread called wait() means it will blocked
untill we will call notify(),notifyAll();
| Is This Answer Correct ? | 49 Yes | 14 No |
Post New Answer View All Answers
What are the various access specifiers for java classes?
What are the uses of synchronized keyword?
When arithmeticexception is thrown?
Can constructor be synchronized?
What is static keyword?
Which class is the superclass for all the classes?
What is the major drawback of internal iteration over external iteration?
Explain different states of a thread in java?
What does %4d mean in java?
What is the memory leak in java?
23. Storage space in java is of the form Stack Queue Heap List 24. What is java code embedded in a web page known as Applets Servlets scriptlets snippets 25. Which of the following attributes are compulsory with an
Explain importance of inheritance in java?
Is java 11 paid version?
Explain purpose of sleep() method in java?
What is indexof in java?