Which of these method is used to avoid polling in Java?
A. wait()
B. notify()
C. notifyAll()
D. All of the mentioned
Answer:A
Which of these method is used to avoid polling in Java?
A. wait() B. notify() C. notifyAll() D. All of the mentioned
Explanation: Polling is a usually implemented by looping in CPU is wastes CPU’s time, one thread being executed depends on other thread output and the other thread depends on the response on the data given to the first thread. In such situation CPU’s time is wasted, in Java this is avoided by using methods wait(), notify() and notifyAll().