Я не могу понять, как скомпилировать мой подкласс, даже если он вызывает конструктор суперклассов?
Этот класс не будет компилироваться:
package departments;
import employees.*;
public class DepartmentEmployee extends Employee{
private Department department;
public DepartmentEmployee(Profile profile, Address address, Occupation occupation, Department department) {
assert (department != null) : "invalid Department";
super(profile, address, occupation);
this.department = department;
}
}
суперкласс:
package employees;
public class Employee {
protected Profile profile;
protected Address address;
protected Occupation occupation;
protected Employee(Profile profile, Address address, Occupation occupation) {
assert (profile != null) : "invalid Profile";
assert (address != null) : "invalid Address";
assert (occupation != null) : "invalid Occupation";
this.profile = profile;
this.address = address;
this.occupation = occupation;
}
}
Подкласс продолжает говорить "не может найти символ - конструктор Сотрудник".Два в разных пакетах.Правильно ли я их связал?