a "draw()" function
So i have this assignment, and in it im supposed to make a shape class (circle, sqare, etc.) and then extend that class and add a "draw()" function, some colors, blabla. The endgame is, we take another students shape and combine it into a GUI application. Press buttons, shapes appear. All of this is fine and I understand, but my instructor says the draw() function has to take a Graphics object as an argument, am I crazy or is paintComponent() the exact same thing. How would any of you implement this draw() function. I have do it because we are adding the draw() method to an interface with some other things as part of the next assignment.
The paintComponent method is called by the JVM. It can do some stuff and then call your new draw methods as needed.