// Hunter Schafer, CSE 143 // This class represents a point on the Cartesian plane public class Point { private int x; private int y; // Constructs a point with the given x and y coordinates public Point(int x, int y) { this.x = x; this.y = y; } // Returns this point's x-coordinate public int getX() { return x; } // Returns this point's y-coordinate public int getY() { return y; } // Translates this point by dx in the x-coordinate and dy in the y-coordinate public void translate(int dx, int dy) { this.x += dx; this.y += dy; } // Returns a String representation of this point. Example: "Point [x=1, y=2]" public String toString() { return "Point [x=" + x + ", y=" + y + "]"; } }