Ich hab folgenden Code, ein paar Fehler habe ich schon selber gefunden, "super" habe ich nicht wirklich verstanden, kann mir wer helfen? Inkl. Erklärung wäre super...
Code: Alles auswählen
public class Fahrzeug{
private int maxSpeed;
public Fahrzeug(){
int maxSpeed;
this.maxSpeed = maxSpeed;
}
protected int getMaxSpeed(){
return maxSpeed;
}
public void move(){
System.out.print("moves on ");
}
public class Landfahrzeug extends Fahrzeug{
public void move(){
System.out.println("moves on land");
}
}
public class Wasserfahrzeug{
public final void move(){
super.move();
System.out.print(" water");
}
}
public final class Traktor extends Landfahrzeug{
public final int maxSpeed=40;
public Traktor(){
super();
super.maxSpeed=this.maxSpeed;
}
public void move(){
System.out.print("Traktor");
this.move();
}
}
public class Amphibienfahrzeug extends Landfahrzeug{
public void move(){
System.out.print("Amphibienfahrzeug ");
super.move();
System.out.print(" with " + getMaxSpeed());
}
}
}