Source of Rectangle.java


  1: //Rectangle.java

  3: public class Rectangle extends Shape
  4: {
  5:     private double length, height;

  7:     Rectangle
  8:     (
  9:         Point upperLeft,
 10:         double length,
 11:         double height
 12:     )
 13:     {
 14:         this.position = upperLeft;
 15:         this.length = length;
 16:         this.height = height;
 17:     }

 19:     @Override
 20:     public double computeArea()
 21:     {
 22:         return (length * height);
 23:     }
 24: }