repaint(), update(),and paint()
The Java system automatically creates a default graphics context, an object of the Graphics class, and passes it as a parameter to the update() and paint() methods. This object is local to those methods, and it cannot be used outside of those methods.