public class Rectangle {
private final int width = 0;
private final int height = 0;
public Point origin;
// use:
public Rectangle() {
origin = new Point(0, 0);
//use
}
public Rectangle(Point p) {
origin = p;
}
public Rectangle(int w, int h) {
origin = new Point(0, 0);
width = w;
height = h;
}
public Rectangle(Point p, int w, int h) {
origin = p;
width = w;
height = h;
}
//
public void move(int x, int y) {
origin.x = x;
origin.y = y;
}
//
public int getArea() {
return width * height;
}
}