abstract class Shape { private double x, y; // position public double getX() { return x; } public double getY() { return y; } public void move(double x, double y) { this.x = x; this.y = y; } public void translate(double dx, double dy) { this.x += dx; this.y += dy; } public String toString() { return String.format("(%g, %g)", getX(), getY()); } }