//Tasha Wallage //Period 7 public class Location { private int x, y; public Location(int x, int y) { this.x = x; this.y = y; } public int getX() { return x; } public int getY() { return y; } public void setLoc(int x, int y) { this.x = x; this.y = y; } public int compareTo(Object o) { Location temp = (Location)o; if(temp.getX()==x && temp.getY()==y) return 0; return -1; } public boolean equals(Object o) { return compareTo(o)==0; } public String toString() { return "Location: ["+x+", "+y+"]"; } }