Explain the purposes of methods wait(), notify(), notifyAll
()?
Answers were Sorted based on User's Feedback
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 |
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 |
which deployment descriptor element is used to configure the authentication method? a. auth-config b. login-config c. sec-config
java is fully object oriented languages or not? why?
how team leaders assign work for the team member like through papers,word document
Which Taglibraury you used in your project? plz send me ans....which we r using generally
Why a client should be multithreading? Explain.
how to create Calculator GUI using Gridbaglayout as like as Window Calculator??????????? (Open calculator Go-->Run-->type calc-->Enter)
What are JTA/JTS and how they used by client?
On a computer that having single CPU, how multithreading concept can be achieved?
Why threads will block on I/O?
What do you mean by Socket Programming?
If we opened Windows Internet Explorer 4 times, does it starts 4 processes or 4 threads?
What is the relationship between an event-listener interface and an event-adapter class?