2021-04-21Java5.2

package jhgdcfvi;

public class A {

int x=1;

void show()

{

System.out.println("class A:");

}

}

class B extends A

{

double x=7.8;

void show() {

System.out.println("class B:");

}

void show1()

{

super.show();

System.out.println(super.x);

show();

System.out.println(x);

}

}

class TestClass

{

public static void main(String srgs[])

{

B bb=new B();

bb.show1();

}

}

你可能感兴趣的:(2021-04-21Java5.2)