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
which is advanced deep technology in java launched by the sun microsystem??? The answer is very logical If u need correct answer mail me at priya_gupta@gmail.com
Why unicode is important?
Difference between character constant and string constant in java ?
explain multi-threading in java?
What are the advantages of arraylist over arrays?
What are extraneous variables examples?
how would you implement a thread pool? : Java thread
What is supplier in java?
how its run?
How an object is serialized in java?
When do we use hashset over treeset?
Why does abstract class have constructor?
What is the difference between a local variable and an instance variable?
Difference between Linked list and Queue?
Write a program to solve producer consumer problem in java?