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
()?

Answers were Sorted based on User's Feedback



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

Answer / tek

All the three methods are called in synchronized block or
method.

wait(): Thread calling wait method will go to the waiting
state and it will loose its monitor. It will execute only
if it is notified by the other threads.

notify(): To notify thread which is waiting for the concern
object.

notifyAll(): To notify all the threads which are in waiting
state.

Is This Answer Correct ?    2 Yes 0 No

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

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

More Advanced Java Interview Questions

difference. between List and Set?

2 Answers   Campus Interaction, HCL, Infotech,


Difference between swing and awt?

0 Answers  


Difference between hashmap and hashtable?

0 Answers  


when we applied start()method on a thread ,how does it know that to execute run()method on that object?

2 Answers   HCL,


Do I need to import javlang package any time? Why ?

0 Answers  


Is 'synchronised' a modifier?

2 Answers   NIIT,


How primary key is implemented in Oracle?

0 Answers  


What is Introspection?

2 Answers  


What is the difference between the ‘font’ and ‘fontmetrics’ class?

0 Answers  


whats is mean by jndi

1 Answers   SolutionNET,


Define prototype?

0 Answers  


How will you pass parameters in RMI? Why do you serialize?

0 Answers  


Categories