62,628
社区成员
发帖
与我相关
我的任务
分享
public class A {
void foo() throws Exception {
throw new Exception();
}
}
public class B extends A{
void foo() {
System.out.println("B");
}
A a = new B();
a.foo();
}
public class B extends A{
void foo() {
System.out.println("B");
}
public static void main(String[] args)
{
A a = new B();
a.foo();
}
}