假设我有以下代码:
为什么
public interface JustAnInterface {
void doSomething();
}
public class JustAnInterfaceImplementation implements JustAnInterface {
@Override
public static void doSomething() {
}
}
为什么
static doSomething()
方法显示"方法未覆盖其超类中的方法"错误?
Interface in = new YourImplementation(); in.interfaceMethod();
这样的代码总是有效的。 - Pshemo