FileDocCategorySizeDatePackage
Rectangle.javaAPI DocExample629Tue Dec 12 18:58:06 GMT 2000None

Rectangle

public class Rectangle extends Object

Fields Summary
public int
width
public int
height
public Point
origin
Constructors Summary
public Rectangle()


    // four constructors
      
	origin = new Point(0, 0);
    
public Rectangle(Point p)

	origin = p;
    
public Rectangle(int w, int h)

	this(new Point(0, 0), w, h);
    
public Rectangle(Point p, int w, int h)

	origin = p;
	width = w;
	height = h;
    
Methods Summary
public intarea()

	return width * height;
    
public voidmove(int x, int y)

	origin.x = x;
	origin.y = y;