blob: a82c505a56cba9de23437bcb15a415a81f0ea328 [file] [log] [blame]
package p;
public class Shape {
Rectangle fBounds;
Rectangle fInnerBounds;
public int area() {
int width= fBounds.getWidth();
int height= fBounds.getHeight();
return width*height;
}
public int filledArea() {
return area() - fInnerBounds.getWidth() * fInnerBounds.getHeight();
}
/**
* Is smaller
* @param rect
* @return boolean
*/
public boolean isSmallerThan(Rectangle rect) {
return rect.isSmallerThan(this);
}
}