public class Rectangle { private double width=1; private double length=1; public Rectangle() { width=1; length=1; }//constructor public Rectangle(double width, double length) { if(width>0) this.width=width; if(length>0) this.length=length; }//constructor public double getWidth() { return width; }//getWidth public void setWidth(double width) { if(width>0) this.width = width; }//setWidth public double getLength() { return length; }//getLength public void setLength(double length) { if(length>0) this.length = length; }//setLength @Override public String toString() { return "" + width + "x" + length; }//toString }//Rectangle