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
What is procedure overloading?
Can we declare main () method as non static?
What is the purpose of lambda expressions?
Can you use abstract and final both with a method?
What is meant by binding in rmi?
What is the Difference between Final Class && Abstract Class?
What is method in java ?
Does string is thread-safe in java?
What is supplier in java?
Which software is used for java programming?
what are Hostile Applets?
What about interthread communication and how it takes place in java?
What is the difference between multitasking and multithreading in Java
Describe 2 different ways to concatenate two strings.
Can you make a constructor final in Java?