两个具有相同方法名称和签名的接口.但是由单个类实现,那么编译器将如何识别哪个接口的方法是什么?
例如:
interface A{
int f();
}
interface B{
int f();
}
class Test implements A, B{
public static void main(String... args) throws Exception{
}
@Override
public int f() { // from which interface A or B
return 0;
}
}
Run Code Online (Sandbox Code Playgroud)