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
Explain about wait() method?
What is the function of static in java?
How does linkedlist work in java?
How to connect to a remote database using Applet?
How to sort an array in java without using sort method?
What data type is string java?
What is the full meaning of java?
Similarity and difference between static block and static method ?
Is ruby built on java?
Enlist diffrent types of inheritance supported by java?
What is the covariant return type?
Why do we need singleton?
Can we use switch statement with strings?
What is the function of character?
Can we initialize the final blank variable?