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
How do you read a char in java?
What is meant by interface?
What is meant by polymorphism?
What is generic class?
What is the use of System class?
What is time complexity algorithm?
What is == and === in javascript?
What is tree node in java?
Are the imports checked for validity at compile time? Will the code containing an import such as java.lang.abcd compile?
What is an empty class? What functionality does it offer in Java?
What are the 5 types of research methods?
What is the covariant return type?
What does null mean in java?
Which is illegal identifier in java?
Which java collection does not allow null?