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

Explain the advantages and disadvantages of detached objects.

1076


How substring() method of string class create memory leaks?

1094


What restrictions are placed on the location of a package statement within a source code file?

1155


What classes of exceptions may be caught by a catch clause?

1078


What are the difference between RMI and CORBA?

1169


How a component can be placed on Windows?

2913


Are enterprise beans allowed to use thread.sleep()?

1196


What are the diff types of exception?

1115


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

1161


int x=5,i=1,y=0; while(i<=5) { y=x++ + ++x; i=i+2; } System.out.println(x); System.out.println(y); System.out.println(i); How to solve this? Please explain!

1886


What are the pros and cons of detached objects?

1039


why static class in java

1818


What is a session? Can you share a session object between different theads?

1036


Can I use javascript to submit a form?

1198


What is prototype?

1258