Constructors
class Point {
private int x,y;
public Point(int x, int y) {
this.x=x;
this.y=y;
}
public int getX() { return x; }
public int getY() { return y; }
public Point getRel(int x, int y) {
return new Point(x-this.x, y-this.y);
}
public Point getRel(Point p) {
return getRel(p.getX(), p.getY());
}
}
Previous slide
Next slide
Back to first slide
View graphic version