假设我有这样的结果: public String foo() { return "A"; }
public class B extends A {有没有一种方法可以多态地让new C().superFoo()调用B.foo() (从而返回"B"),而不需要覆盖C中的superFoo()?return getClass().getSuperclass().getDeclaredMethod("foo").invoke(this)),希望
我在我的程序中使用了实现继承,并且我的子类中的方法没有在main方法中被调用。它显示错误"The method getArea() is not defined in type Second“。package firstproject;import java.util.Date;public有关计算三角形面积的公式,请参见编程练习2