What is update method and when it is called?
Answers were Sorted based on User's Feedback
Answer / raghuveer
update(Observable o,Object arg)
This method is called whenever the observed object is
changed. An application calls an Observable object's
notifyObservers method to have all the object's observers
notified of the change.
where:
o - the observable object.
arg - an argument passed to the notifyObservers method
| Is This Answer Correct ? | 17 Yes | 6 No |
Answer / mayank
The update() method is defined by the AWT and is
called when your applet has requested that a
portion of its window be redrawn. The problem is
that the default version of update() first fills
an applet with the default background colour and
then calls paint(). You can override the update()
method. The paint() in this case will simply call
update().
public void update(Graphic g) {
//Redisplay your window here.
}
public void paint(Graphics g) {
update(g); // call to the update()method.
}
| Is This Answer Correct ? | 10 Yes | 0 No |
Why is string builder not thread safe?
What do you mean by singleton class in java?
Can we add two byte variables and assign the result to a byte variable ? b=b1+b2 where b,b1,b2 are byte types
This is related to threads. I have a class with synchronized method m1(). Can I create different instances of this class and execute the m1() for different threads?
What is byte code and why is it important to java’s use for internet programming?
Why stringbuffer is faster than string?
what is domain object
What is method in java ?
Is java 1.7 the same as java 7?
What are access modifiers?
What are controls and their different types in awt?
what is features of jdk 1.5?
2 Answers Accenture, Satyam, TCS,