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

What does replaceall do in java?

869


How do you read and print a string in java?

906


Name some classes present in java.util.regex package.

980


How do you declare an array that will hold more than 64KB of data?

1190


What's the default access specifier for variables and methods of a class?

1049


Explain about procedural programming language or structured programming language and its features?

1028


How to make a non daemon thread as daemon?

1012


Explain about public and private access specifiers?

974


Explain wait() method of object class ?

1133


What is a lightweight component?

968


Who is founder of java?

944


What is the difference between logical data independence and physical data independence?

979


Can java arraylist hold different types?

990


How are the elements of a gridbaglayout organized in java programming?

935


What are the types of collections in java?

1001