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

Explain the purposes of methods wait(), notify(), notifyAll
()?

Answer Posted / sumitpalsingh

The purpose of using the wait(),notify() and notifyAll() methd is used for interThread communication.
for Example :-There is a n situation communication between Producer and Consumer...Producer wll produce an item and go to waiting state by using wait() method.and it will notify to the consumer for to consume an item. After conume an Item Consumer will come into waiting state by using wait() method ..and give the notification to Produer by using notify() method to produce an item.But all these methods are called only in synhronized() method or synchronized block.

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Do I have to use jsps with my application?

972


What is the purpose of the notifyall() method?

986


Which characters may be used as the second character of an identifier, but not as the first character of an identifier?

994


What is Remote Server?

2144


which book is better for jdbc ,servlets and jsp

2046


what is the use of State Factories?

2325


how to use debug in my elipse to solve problems that exist in my project

2214


What is abstract schema?

967


Difference between hashmap and hashtable?

1087


Is the ternary operator written x : y ? Z or x ? Y : z ?

1049


What is threadfactory?

1036


What class is used to create Server side object ?

2174


What is the difference between a static and a non-static inner class?

1087


What is the difference between system.out ,system.err and system.in?

1047


Is “abc” a primitive value?

1048