//  Data Structures with Java by John R. Hubbard
//  Copyright McGraw-Hill, 2001
//  Example 3.1 on page 53
//  Extending the Point class

public class Ex0301
{ public static void main(String[] args) 
  { ColoredPoint p = new ColoredPoint(2,3,"green");
    System.out.println("p = " + p);
    ColoredPoint q = new ColoredPoint(2,3,"green");
    System.out.println("q = " + q);
    if (q == p) System.out.println("q == p");
    else System.out.println("q != p");
    if (q.equals(p)) System.out.println("q equals p");
    else System.out.println("q does not equal p");
    q.setColor("red");
    System.out.println("q = " + q);
    if (q.equals(p)) System.out.println("q equals p");
    else System.out.println("q does not equal p");
  }
}
