我们知道在Java中我们无法实现多重继承,但是可以通过接口(interface)来实现。
我被困住了。情况是这样的,
interface A {
void a();
}
interface B {
void a();
}
class AB implements A, B {
@Override
public void a() {
// which interface's method be implemented?
// Log.d("TAG", "Name of Interface: " + /*get the name of interface*/);
}
}
请给我推荐一些东西。
最佳答案
实现哪种接口(interface)方法并不重要,因为只实现了一种方法。任何接口(interface)都可以引用它。
关于java - 哪个接口(interface)的方法在类中实现了,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51981074/