what is the difference between sleep() and Wait()?
Answer Posted / kumaran
thread.sleep(2000) - this will block the thread exactly 2000
milliseconds.
thread.wait(2000) - this will block the thread upto 2000
milliseconds.
i.e if thread.notify() calls before 2000 milliseconds, the
thread will become active incase if the thread is blocked by
wait().
Is This Answer Correct ? | 14 Yes | 7 No |
Post New Answer View All Answers
Differentiate between array list and vector in java.
Why string objects are immutable in java?
Why do we need wrapper class?
There are two classes named classa and classb. Both classes are in the same package. Can a private member of classa can be accessed by an object of classb?
Can we create a class inside a class in java?
What are the basic interfaces of java collections framework?
Define "Access specifiers" in java.
What are the important features of Java 8 release?
What does a za z0 9 mean?
Is there any tag in htm to upload and download files?
Can java run on google chrome?
How do I convert a string to an int in java?
How to check if linked list contains loop in java?
How objects are stored in java?
How many bits is a float?