I have three classes. Class A is titled Circle
. Class B is titled ColorfulCircle
. Class C is titled ColorfulBouncingCircle
. I need to inherit the methods public double getCenterY(), public double getCenterX, and public void setCenterCoordinates(double centerX, double centerY) from Class “A” Circle so that I can use them in Class “C” ColorfulBouncingCircle.
Circle looks like this:
class Circle {
private double centerX, centerY;
public double getCenterX() {
return centerX;
}
public double getCenterY() {
return centerY;
}
public void setCenterCoordinates(double centerX, double centerY) {
this.centerX = centerX;
this.centerY = centerY;
}
}
There are the exact methods I need to be able to use in ColorfulBouncingCircle
so that I can use the centerX
and centerY
variables in code over there.
I just need to know exactly what do I type in to the ColorfulBouncingCircle
class so that I can use them.
Thank you.