本帖最后由 迦罗叶 于 2014-2-27 18:29 编辑
- class Demo1 {
- public static void main(String[] args) {
- Child c = new Child();
- }
- }
- class Parent {
- Parent() {
- show();
- }
- void show() {
- System.out.println("parent show");
- }
- }
- class Child extends Parent {
- int num = 4;
- Child() {
- super();
- show();
- }
- void show() {
- System.out.println("child show........." + num);
- }
- }
复制代码
|