import java.awt.*; public class PointMain { public static void main(String[] args) { // construct two Point objects Point p1 = new Point(7, 2); Point p2 = new Point(4, 3); // print each point and their distance apart System.out.println("p1 is " + p1); System.out.println("p2: (" + p2.x + ", " + p2.y + ")"); System.out.println("distance = " + p1.distance(p2)); // translate the point to a new location p2.translate(1, 7); p2.x = 3; System.out.println("p2: (" + p2.x + ", " + p2.y + ")"); System.out.println("distance = " + p1.distance(p2)); compare(p1, p2); } public static void compare(Point a, Point b) { System.out.println(); if (a.equals(b)) System.out.println("The points are the same."); else System.out.println("The points are different."); } }