/** Rectángulo con ancho y alto que se cambian por separado. */
public class Rectangle {
    private int width;
    private int height;

    public Rectangle(int width, int height) {
        this.width = width;           // campos directos: no llamar a los setters,
        this.height = height;         // de los que una subclase podría hacer override
    }

    /** Postcondición: cambia el ancho y deja el alto como estaba. */
    public void setWidth(int width) {
        this.width = width;
    }

    /** Postcondición: cambia el alto y deja el ancho como estaba. */
    public void setHeight(int height) {
        this.height = height;
    }

    public int width() {
        return width;
    }

    public int height() {
        return height;
    }

    public int area() {
        return width * height;
    }
}
