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...

diff b/w sleep(1000) and wait(1000)?

Answer Posted / rajani nagandla

The sleep method is used when the thread has to be put
aside for a fixed amount of time. Ex: sleep(1000), puts the
thread aside for exactly one second. The wait method is
used to put the thread aside for up to the specified time.
It could wait for much lesser time if it receives a notify
() or notifyAll() call. Ex: wait(1000), causes a wait of up
to one second. The method wait() is defined in the Object
and the method sleep() is defined in the class Thread.

Is This Answer Correct ?    44 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain about wait() method?

1075


What is the function of static in java?

1158


How does linkedlist work in java?

991


How to connect to a remote database using Applet?

2612


How to sort an array in java without using sort method?

938


What data type is string java?

1006


What is the full meaning of java?

1101


Similarity and difference between static block and static method ?

983


Is ruby built on java?

992


Enlist diffrent types of inheritance supported by java?

979


What is the covariant return type?

1177


Why do we need singleton?

1023


Can we use switch statement with strings?

1097


What is the function of character?

1114


Can we initialize the final blank variable?

1131