aboutsummaryrefslogtreecommitdiffstats
path: root/csci1913/Java/lab6/lab6_strap012.java
blob: e2c96e4a4eab84472a733db5e9069d8fd2119955 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package lab6;

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);
    }
}