Die fertige Klasse steht unten.
Die show() Methode von MusicVideo
kann super.show() überall da verwenden,
wo es notwendig ist.
Es ist die erste Anweisung (unten),
da sei da am sinnvollsten ist.
class VideoTape
{
// stuff ommitted here
public void show()
{
System.out.println( title + ", " + length + " Min. verfuegbar:" + avail );
}
}
class MusicVideo extends VideoTape
{
String artist;
String category;
// Konstruktor
public MusicVideo ( String ttl, int len, String art, String cat )
{
super( ttl, len );
artist = art;
category = cat;
}
public void show()
{
super.show();
System.out.println( "Kuenstler:" + artist + " Kategorie: " + category );
}
}