// Zorah Fung, CSE 142 // This client program shows an example of creating and using // Point objects created from our Point class template. public class PointClient { public static void main(String[] args) { // Create a new Point object initializing x to 3 and y to 4 Point p1 = new Point(3, 4); Point p2 = new Point(6, 8); // p2.x = -100000; // x is a private field. Would give me an error. // Create a new "default" Point. Point p3 = new Point(); System.out.println("p1 = " + p1); System.out.println("p2 = " + p2); System.out.println("p3 = " + p3); System.out.println("Distance of p1 = " + p1.distanceFromOrigin()); System.out.println("Distance of p2 = " + p2.distanceFromOrigin()); p1.translate(2, 3); p2.translate(4, 8); System.out.println("p1 = " + p1); System.out.println("p2 = " + p2); } }