// CSE 143, Autumn 2013 // Represents a location on an x-y plane public class Point { private int x; private int y; // creates a new point with the given coordinates public Point(int x, int y) { this.x = x; this.y = y; } // Returns true if the passed in object is a Point // and has the same x and y values as this Point, // returns false otherwise. public boolean equals (Object o) { if(o instanceof Point) { int otherX = ((Point) o).x; int otherY = ((Point) o).y; return otherX == x && otherY == y; } else { return false; } } }