// This client program constructs three points by calling constructors, // translates two of the points, and then reports the distance between two of // them. public class PointTest2 { public static void main(String[] args) { Point p1 = new Point(3, 5); Point p2 = new Point(12, 4); Point p3 = new Point(); p1.translate(3, 5); p2.translate(6, 8); System.out.println("p1 distance = " + p1.distanceFromOrigin()); System.out.println("p2 distance = " + p2.distanceFromOrigin()); double distance = p1.distance(p2); System.out.println("distance between p1 & p2 = " + distance); } }