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 |
Can an object be null?
how can be object class inherited to all class in a program when java does not support multiple inheritance??
How do you check whether the list is empty or not in java?
Explain about anonymous inner classes ?
Which is the best sorting technique in java?
what Data encapsulation in java?
Why should we use java?
What is the access scope of protected access specifier?
How do you format in java?
What are the practical benefits, if any, of importing a specific class rather than an entire package (e.g. Import java.net.* Versus import java.net.socket)?
why the equals method can be override?when we override the equals method?
What class is used to create Server side object?