i am not sure how this class of yours is compiling
public class Employee extends Person {
private int id;
public Employee(String name, int id) {
this.id = id;
this.name = name;
}
}
When you say this.name = name and the Person.name is private, this should not compile if you have not defined another variable called name in Employee class.
Back to your question, you need to call the Person's constructor in the Employee consructor, something like this
public class Employee extends Person {
private int id;
public Employee(String name, int id) {
super(name);
this.id = id;
}
}