// Define a new "type" of data called Point public class Point { private static final int MAX_TRANSLATIONS = 5; // State private int x; private int y; private int translateCount; // Count number of translations // Constructors public Point() { this.x = 0; this.y = 0; translateCount = 0; } public Point(int x, int y) { this.x = x; this.y = y; translateCount = 0; } // Behavior public void translate(int dx, int dy) { // Limit number of translates on each Point if (translateCount >= MAX_TRANSLATIONS) return; this.x += dx; this.y += dy; translateCount++; } public String toString() { return "(" + this.x + "," + this.y + ")"; } // Accessor (getters) public int getX() { return this.x; } public int getY() { return this.y; } // Mutator (setter) public void setX(int x) { this.x = x; } public void setY(int y) { this.y = y; } }