package methods;

class Rectangle {

	int x;
	int y;
	int width;
	int height;

	public Rectangle(int x,int y, int width, int height) {
		this.x=x;
		this.y=y;
		this.width=width;
		this.height=height;
	}

	public String toString() {
		return "Rectangle @(" + x + "," + y + ") to (" + (x+width) + "," + (y+height) + ")";
	}

	public static void strans(Rectangle rect,int dx, int dy) {
		rect.x += dx;
		rect.y += dy;
	}

	public void trans(int dx,int dy) {
		x+=dx;
		y+=dy;
	}

	public Rectangle(int width, int height) {
			this.x = 0;
			this.y = 0;
			this.width = width;
			this.height = height;
	}

	public int getWidth() { return width; }

	public int area() { return width*height; }
}