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
Can an arraylist be empty?
What is a values collection view ?
What is json parser in java?
What is the independent variable in an experiment?
What is jit and its use?
What is variable explain?
What do you mean by constructor?
Do you need to import math in java?
What are some alternatives to inheritance?
What is synchronization and why is it important in java programming?
In a program, initializing an array of 100 KB is throwing an out of memory exception while there is 100 MB of memory available. Why?
Can arraylist hold different types java?
Which number is denoted by leading zero in java?
What is the difference between conversation & casting?
What is an example of a conditional statement?