package InterfaceDemo; /** * RectangularCrossSection.java * * * Created: Tue Feb 13 20:05:46 2001 * * @author Stuart C. Shapiro * * The class of rectangular cross sections. */ public class RectangularCrossSection extends CrossSection{ /** The length of this cross section. */ private double length, /** The width of this cross section. */ width; /** * Constructs a rectangular cross section. * @param l The length of this rectangular cross section. * @param w The width of this rectangular cross section. */ public RectangularCrossSection (double l, double w){ super(); length = l; width = w; } /** Returns the area of this rectangular cross section. */ public double getArea(){ return length * width; } }// RectangularCrossSection