/** test the TwoDPoint class. */
public class TestTwoDPoint {
  public static void main(String args[]) {
    TwoDPoint p1 = new TwoDPoint(10, 20);  // create new object
    TwoDPoint p2 = new TwoDPoint(p1);  // create an object identical to p1
    TwoDPoint p3 = p2;  // p3 and p2 "reference" the same object
    // change the object both p2 and p3 reference    
    p3.setX(40);
    p3.setY(50);

    System.out.println(p1.toString());
    System.out.println(p2.toString());  // print the changed x and y
    double dist = p1.distance(p2);
    System.out.println("the distance = " + dist);
  }
}
