// Helene Martin, CSE 142 // Demonstrates usage of our custom Point class. public class PointClient { public static void main(String[] args) { Point p1 = new Point(); p1.x = -11; p1.y = 67; Point p2 = new Point(); p2.x = 87; p2.y = 98; Point p3 = p2; p3.x = 17; //p1.x += 3; //p1.y += 4; //translate(p1, 3, 4); p1.translate(3, 4); //p2.x += 7; //p2.y += 8; //translate(p2, 7, 8); p2.translate(7, 8); System.out.println("p1: " + p1.x + ", " + p1.y); System.out.println("p2: " + p2.x + ", " + p2.y); } // moves a point by dx, dy. // this static method would need to be copied into every client // so putting the behavior in the Point class is better //public static void translate(Point p, int dx, int dy) { // p.x += dx; // p.y += dy; // } }