`

Father、Mother、Children输出结果

 
阅读更多

[size=large][color=blue]
package test;

class Test {
 public static void main(String[] args) {
  new Children();
 }
}

class Mother {
 public Mother() {
  System.out.println("This is Mother");
 }
}

class Father {
 public Father() {
  System.out.println("This is Father");
 }
}

class Children extends Father {
 public Children() {
  System.out.println("This is Children");
 }

 Mother mother = new Mother();
}

输出结果:

This is Father
This is Mother
This is Children[/color][/size]
 
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics