getMethods 与 @Override

发布时间 2023-07-14 10:57:11作者: silyvin
import java.lang.reflect.Method;

public class Test {
public static void main(String []f){
Method [] methods = B.class.getMethods();
}

private static class A {
public A xxx() {
return new A();
}
}

private static class B extends A {
@Override
public B xxx() {
return new B();
}
}
}
返回 两个方法