class A
{
class B
{
void show()
{
System.out.println("调用成功");
}
}
}
class C extends B
{
void xiu()
{
System.out.println("子类调用成功");
}
}
class Ceshi2
{
public static void main(String[] args)
{
//System.out.println("Hello World!");
C c = new C();
c.xiu();
c.show();
}
}
//此段代码是无法编译通过的,会提示c.show()找不到符号,然而注释掉c.show()以后此段代码可以通过编译,那么问题来了,既然已经实现了继承,为何子类无法调用父类方法?
|