aboutsummaryrefslogtreecommitdiffstats
path: root/csci1913/Java/lab6/lab6_strap012.java
blob: 5062a607fd8b57b26f116789876743c68e64eb6d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
class Rectangle extends Polygon {
    public Rectangle(int l, int w) {
        super(4, l, w, l, w);
    }
    public int area() {
        return this.side(0)*this.side(1);
    }
}

class Square extends Polygon {
    public Square(int l) {
        super(4, l, l, l, l);
    }
    public int area() {
        return this.side(0)*this.side(1);
    }
}