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
What is singletonlist in java?
What is oop in java?
how we can use debug in myeclipse 6.0 in order solve the problems that exist in our program when there are 900 to 1000 pages in a web application
What does this mean java?
What is the difference between serializable and externalizable interfaces?
What the difference is between execute, execute Query, execute Update?
What is the use of java?
Is stringwriter thread safe?
can rmi and corba based applications interact ?
How to convert string to byte array and vice versa?
What is string substring?
What are three ways in which a thread can enter the waiting state in java programming?
Can we use static class instead of singleton?
How do you replace a string in java?
How do I get 64 bit java?