public class Rectangle { int width, height; public Rectangle(int width, int height) { if( width <= 0 || height <= 0) throw new IllegalArgumentException(); this.width = width; this.height = height; } public int getWidth() { return width; } public int getHeight() { return height; } @Override public String toString() { return "width: "+width+", height: "+height; } }