Can anybody tell me why this code isn't correct?
public class Boss extends Angestellter {
Boss(String v, String n, int a) { // ERROR **
vorname = großKleinSchreibung(v);
nachname = großKleinSchreibung(n);
alter = a;
}
}
** Implicit super constructor Angestellter() is undefined. Must explicitly invoke another constructor
public class Angestellter {
protected String vorname;
protected String nachname;
public int alter;
Angestellter(String v, String n, int a) {
this.vorname = großKleinSchreibung(v);
this.nachname = großKleinSchreibung(n);
this.alter = a;
}
I dont find the error, because its exactly how its explained in the book which im using to learn oop with java.
Angestrellterdoesn't have non-parametric constructor. So you must callsuper(String v, String n, int a)in your constructorBoss