-
Which of this method is used to avoid polling in Java?
-
- notify()
- notifyAll()
- wait()
- All of above
- 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().