import java.awt.*; //to be more specific, java.awt.Point does the job public class CannonBall extends Ball { public CannonBall (Point loc, int r, double dx, double dy) { super(loc, r); //invoke Ball's constructor setMotion(dx, dy); } public static final double GravityEffect = 0.3; public void move () { changeInY += GravityEffect; //short for changeInY = changeInY + GravityEffect; super.move(); //update the ball position } }