1.

Which of these methods calls update() method?(a) notify()(b) observeObject()(c) updateObserver()(d) notifyObserver()This question was addressed to me in an interview.I need to ask this question from Observable & Timer Class in portion java.util – More Utility Classes of Java

Answer»

The correct answer is (d) notifyObserver()

For EXPLANATION: notifyObserver() NOTIFIES all the OBSERVERS of the invoking OBJECT that it has changed by calling update(). A NULL is passed as the second argument to update().



Discussion

No Comment Found

Related InterviewSolutions