Home » JAVA Programming » Multithreading » Question
  1. Which of this method is used to avoid polling in Java?
    1. notify()
    2. notifyAll()
    3. wait()
    4. All of above
    5. None of these
Correct Option: D

Polling is a usually implemented by looping in CPU is wastes CPU 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 time is wasted, in Java this is avoided by using methods wait(), notify() and notifyAll().



Your comments will be displayed only after manual approval.