public class Square extends Rectangle {

	/**
	 * Create a square given the side
	 * 
	 * @param side
	 *            (side > 0)
	 */
	public Square(int side) {
		// call the constructor for the superclass
		// create a rectangle with all sides of equal dimension
		super(side, side);
	}

	/**
	 * Set the length of the square. This method overrides the setLength( int )
	 * method in the superclass. Because this method is for a Square, it also
	 * sets the width appropriately.
	 * 
	 * @param l
	 *            the new length of the square, l > 0
	 */
	public void setLength(int l) {
		setSide( l );
	}

	/**
	 * Set the width of the square. This method overrides the setWidth( int )
	 * method in the superclass. Because this method is for a Square, it also
	 * sets the length appropriately.
	 * 
	 * @param w
	 *            the new width of the square, w > 0
	 */
	public void setWidth(int w) {
		setSide( w );
	}

	// let us add a new method to set the side of the square
	// a subclass can contain more methods than the superclass
	/**
	 * Set the side of the square
	 * 
	 * @param s
	 *            the new side of the square, s > 0
	 */
	public void setSide(int s) {
		if (s > 0) {
			super.setLength(s);
			super.setWidth(s);
		}
	}
}

@@ -285,960 +285,7 @@
 %09%7D%0A%0A
-%09/**%0A%09 * Set the length of the square. This method overrides the setLength( int )%0A%09 * method in the superclass. Because this method is for a Square, it also%0A%09 * sets the width appropriately.%0A%09 * %0A%09 * @param l%0A%09 *            the new length of the square, l %3E 0%0A%09 */%0A%09public void setLength(int l) %7B%0A%09%09setSide( l );%0A%09%7D%0A%0A%09/**%0A%09 * Set the width of the square. This method overrides the setWidth( int )%0A%09 * method in the superclass. Because this method is for a Square, it also%0A%09 * sets the length appropriately.%0A%09 * %0A%09 * @param w%0A%09 *            the new width of the square, w %3E 0%0A%09 */%0A%09public void setWidth(int w) %7B%0A%09%09setSide( w );%0A%09%7D%0A%0A%09// let us add a new method to set the side of the square%0A%09// a subclass can contain more methods than the superclass%0A%09/**%0A%09 * Set the side of the square%0A%09 * %0A%09 * @param s%0A%09 *            the new side of the square, s %3E 0%0A%09 */%0A%09public void setSide(int s) %7B%0A%09%09if (s %3E 0) %7B%0A%09%09%09super.setLength(s);%0A%09%09%09super.setWidth(s);%0A%09%09%7D%0A%09%7D
 %0A%7D%0A

Update Square.java