All pastes #936423 Raw Edit

Stuff

public text v1 · immutable
·published 2008-03-10 12:53 UTC
rendered paste body
/*
 * Point.java
 */

package homework1.solution;

/**
 * @author Yim
 */

public class Point {
    int x;
    int y;
    public Point(int a, int b) {
        this.x=a;
        this.y=b;
    }
    
    @Override
    public boolean equals(Object o) {
        if (o instanceof Point) {
            Point p = (Point)o;
            if (this.x==p.x && this.y==p.y){
                return true;
            }else{
                return false;
            }
        }else{
            return false;
        }
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 11 * hash + this.x;
        hash = 11 * hash + this.y;
        return hash;
    }
}