what is the difference between sleep() and Wait()?
Answer Posted / tisty
Simply speaking, we will use sleep() for pausing a thread
intentionally for some amount of time which we mentions in
milliseconds as the argument of sleep() method and,
wait() method is used whenever there is a communication is
needed between the threads, say if one thread's execution
is depended on the the execution of others.
The thread went on sleep will continue its execution after
the timeperiod. on the other hand, the thread undergone
wait will get activated on a notify() or notifyall() method.
| Is This Answer Correct ? | 6 Yes | 2 No |
Post New Answer View All Answers
What language is java written?
Given a singly linked list, determine whether it contains a loop or not without using temporary space?
hi am an engineering student and my next plan is for ms in either in us or australia i got my passport but i dont know anything bout visa can u give brief idea 1)How to get prepared for visa and 2)How to apply for top universities and 3)How to pay the fee and so on These all are basic questions plz give me a clear idea
Is null a string in java?
What are autoboxing and unboxing? When does it occur?
What is percentage in java?
Are there structures in java?
Write a java program to count the number of words present in a string?
Is java written in c?
What is meant by attribute?
Write an algorithm program in java for the following question.. 1) S is a set of integers.X is an integer obtained by sum of two digits in S. Write logic for whether or not the X is from the S. The time of algorithm should not exceed o(n logn).
what do you mean by marker interface in java?
Is java a security risk?
What do you understand by copy constructor in java?
Can a list be null in java?