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 / kumaran

thread.sleep(2000) - this will block the thread exactly 2000
milliseconds.

thread.wait(2000) - this will block the thread upto 2000
milliseconds.

i.e if thread.notify() calls before 2000 milliseconds, the
thread will become active incase if the thread is blocked by
wait().

Is This Answer Correct ?    14 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you read a char in java?

951


What is meant by interface?

1016


What is meant by polymorphism?

959


What is generic class?

1039


What is the use of System class?

1096


What is time complexity algorithm?

993


What is == and === in javascript?

994


What is tree node in java?

925


Are the imports checked for validity at compile time? Will the code containing an import such as java.lang.abcd compile?

1037


What is an empty class? What functionality does it offer in Java?

1204


What are the 5 types of research methods?

1088


What is the covariant return type?

1026


What does null mean in java?

1018


Which is illegal identifier in java?

1020


Which java collection does not allow null?

1093