Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

Which is better ascii or unicode?

1042


Compare java and python.

1034


What is a generic data type?

1120


What is an immutable class? How to create an immutable class?

1116


What is the difference between compiler and jvm?

1109


Is java still necessary?

1144


Explain the polymorphism principle?

1077


Describe the term diamond problem.

1092


What is += mean in java?

1054


What is the difference between a synchronized method and a synchronized block?

1123


What do you mean by exception handling in Java?

1366


What are pass by reference and pass by value?

1039


Explain about static nested classes in java?

1112


Can we make the abstract methods static in java?

1103


What environment variables are required to be set on a machine in order to run Java programs?

1276