Can you improve my code?
Ihr würde mich freuen wenn ihr die fehller in mein code verbessern könnt dankeschön public abstract class Person { private String name; @java.lang.Override public java.lang.String toString() { return "Person{" + "name='" + name + '\'' + '}'; } public Person(String name) { this.name = name; } public abstract void statusAusgeben(); public String getName() { return name; } public void setName(String name) { this.name = name; } } ///////////////////////////////////////////////////////// public class Schueler extends Person { public Schueler(){ this("NN"); } public Schueler(String name) { super(name); } @Override public void statusAusgeben() { System.out.println("mein Name ist " + getName()); } } ///////////////////////////////////////////////// public class Lehrer extends Person { public Lehrer(String name) { super(name); } @Override public void statusAusgeben() { System.out.println("Ich bin Lehrer und mein Name ist " + getName()); } }
Only in this class I found the error, the code also improved.