Write a draw method (both header and body) for the Ball class that will allow a Ball object to draw itself. You may assume the class has the following instance variables: xPos, yPos, diameter, color. The first three are of type int, and the last is of type Color.
a) drawBall(int xPos, int yPos, int diameter, Color color) { /* method body / }
b) void draw() { / method body / }
c) void drawBall(Graphics g) { / method body / }
d) drawBall() { / method body */ }

Q&A Education