public class GraphicCircle
extends Circle {
Color outline, fill;
public
GraphicCircle(double x, double y, double r, Color outline, Color fill)
{
super(x, y, r);
this.outline = outline;
this.fill = fill;
}
public
void draw(DrawWindow dw) {
dw.drawCircle(x, y, r, outline, fill);
}
}
Das Schlüsselwort "extends" definiert eine neue Unterklasse.
Die Constructor-Methode der Oberklasse kann mit "super(...);"
aufgerufen werden.
Mit "final" deklarierte Klassen können nicht vererbt
werden.