Explain the use of update() method. When is it invoked?- An update() method is called on calling the repaint method.
- The default implementation of the update() method clears the screen and calls the paint() method.
- The graphics instance is valid only within the context of the update method() returns.
- This method is called in response to repaint() request.
- The default implementation is provided by the component class which erases the background and calls the paint() method.