继承--构造方法
1,
父空参
子空参
2.
父空参
子空参
---
public class Fu {
public Fu() {
System.out.println("fu gouzao");
}
public Fu(int i) {
System.out.println("fu youcan");
}
}
---
public class Zi extends Fu {
public Zi() {
System.out.println("zi show");
}
public Zi(int i) {
System.out.println("zi youcan");
}
}
---
public class Test {
public static void main(String[] args) {
new Zi(10); //走的父空构造,子有参构造
}
}
------