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
How do you use wildcards?
Is void a keyword in java?
What are reference variables in java?
Explain about doubly linked list
What is an example of declaration?
Explain aggregation in java?
What is lexicographically smallest string?
What are the data types supported by java?
What is JVM and is it platform independent?
What is bean? Where it can be used?
Is 0 true or false in java?
What is internal iteration in java se 8?
What is anagram word?
What are the advantages and disadvantages of reference counting in garbage collection?
What happens if we override private method?