Answer Posted / rajani nagandla
The sleep method is used when the thread has to be put
aside for a fixed amount of time. Ex: sleep(1000), puts the
thread aside for exactly one second. The wait method is
used to put the thread aside for up to the specified time.
It could wait for much lesser time if it receives a notify
() or notifyAll() call. Ex: wait(1000), causes a wait of up
to one second. The method wait() is defined in the Object
and the method sleep() is defined in the class Thread.
Is This Answer Correct ? | 44 Yes | 6 No |
Post New Answer View All Answers
If try block is successfully executed, Then Is Finally block executed?
Where are local variables stored?
What is a line separator in java?
Which access specifier can be used with class ?
What do you mean by scope of variable?
what is interface in java? Explain
Java is Pass by Value or Pass by Reference?
What is replaceall in java?
how to one war file class to another war file class?
Explain java coding standards for methods?
Can inner class final?
What do you mean by of string::valueof expression in java 8?
Explain about the interpreter in java?
What is the purpose of main function in java?
Which graphs are functions?