public class Test2 {
public static void main(String[] args) {
new Zi1();
}
}
class Fu1 {
static int x = 20;
int i = 4;
{
int j = 5;
}
public Fu1() {
System.out.println("父类的构造方法");
show();
}
public void show() {
System.out.println(i);
}
}
class Zi1 extends Fu1 {
static int x = 7;
int i = 6;
{
int j = 7;
}
public Zi1() {
super();
System.out.println("子类的构造方法");
show();
}
public void show() {
System.out.println("子类"+i);
}
}