public static void main(String[] args)
{
Zi f = new Zi();
f.method1();
f.method2();
f.method3(); // 为什么这个调用不了?子类不是继承了父类的了么?
f.method4();
}
}
class Fu
{
static int num = 5;
void method1()
{
System.out.println("fu method_1");
void method2()
{
System.out.println("fu method_2_"+num);
}
static void method4()
{
System.out.println("fu method_4");
}
}
class Zi extends Fu
{
static int num = 8;
void method1()
{
System.out.println("zi method_1_"+num);
}