我有这个界面:
public interface Library {
public abstract void addEmployee (Employee employee);
}
三个类实现了此接口:
public class CentralLibrary extends Store implements Library {
@Override
public void addEmployee(Employee employee, char determiner) {
}
}
public class LibraryA extends CentralLibrary implements Library {
@Override
public void addEmployee(Employee employee) {
}
}
public class LibraryB extends CentralLibrary implements Library {
@Override
public void addEmployee(Employee employee) {
}
}
无论如何,是否有其他签名覆盖
addEmployee
方法? 最佳答案
您没有覆盖,而是超载。为此,您必须在接口的方法签名中添加char determiner
作为第二个参数