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 / modi[achir communication pvt.

Wait() : This function takes parameters as milliseconds and
puts the thread in wait state for the desired time of the
programmer after time passes the execution starts again.

Sleep() : This function is also used for same purpose using
his function by java you can put a thread in sleep state
.sleep does not contains any parameters so the thread will
not be automatically start execution It needs a wake up
signal again which can be Notify().or other function are
also provided by java.

So the main difference in Wait() and sleep() is wait takes
time parameter and wait for specific time only and sleep
throws a thread in sleep mode for unspecified time.

Is This Answer Correct ?    6 Yes 105 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are abstract classes and anonymous classes?

1075


Are arrays passed by reference in java?

917


What is t in generics in java?

1070


What is a singleton factory?

956


How to reverse a string in java?

1084


Explain importance of inheritance in java?

1028


According to java operator precedence, which operator is considered to be with highest precedence?

1090


What are the main features of java?

972


What is bean? Where it can be used?

1087


What is the use of generics? When was it added to the Java development Kit?

1021


Why is core java important?

1047


Is zero a natural number?

1038


Is singleton set an interval?

968


What is the exact difference in between unicast and multicast object? Where we will use?

999


Should database connections be singleton?

965