import java.awt.Color;
class Rectangle {
double x, y, width, height;
public Rectangle(double x, double y, double width, double height) {
this.x = x;
this.y = y;
this.width = width;
this.height = height;
}
public Rectangle(double x, double y) {
this(x, y, 10, 10);
}
public Rectangle() {
this(1, 1);
}
}
class MyRectangle extends Rectangle {
Color outerColor;
Color innerColor;
public MyRectangle(double x, double y, double width, double height,
Color outer, Color inner) {
super(x, y, width, height);
outerColor = outer;
innerColor = inner;
}
public MyRectangle(Color outer, Color inner) {
super(10, 10, 100, 100);
outerColor = outer;
innerColor = inner;
}
public MyRectangle() {
super();
outerColor = Color.black;
innerColor = Color.white;
}
}
|