如果 class 以类似的方法实现多个接口,是否会重载?

Is it overloading if a class implements muplitple interfaces with similar methods?

我很好奇,如果一个class实现了两个或多个具有类似方法的接口,是否可以被视为方法重载。如果不是,那么正确的术语是什么?

举个例子

public interface I1 {
  int method1(String input);
}

public interface I2 {
  void method1(int input);
}

public class C1 implements I1, I2 {
  public int method1(String input){ return 0;}

  public void method1(int input){}
}

重载归结为:

In Java, two or more methods may have the same name if they differ in parameters (different number of parameters, different types of parameters, or both). These methods are called overloaded methods and this feature is called method overloading.

来自 here.

所以,显然,您的 class C1 过载 method1()。它这样做是为了 覆盖 这两种方法的事实并没有改变这一点。如果重载也发生,与重载的定义无关。