class B extends A {
public function B ( ) {
super( );
}
}
class B extends A {
}
class Rectangle {
protected var w = 0;
protected var h = 0;
public function Rectangle (width, height) {
setSize(width, height);
}
public function setSize (newW, newH) {
w = newW;
h = newH;
}
public function getArea ( ) {
return w * h;
}
}
class Square extends Rectangle {
public function Square (side) {
super(side, side);
}
override public function setSize (newW, newH) {
if (newW == newH) {
super.setSize(newW, newH);
}
}
}