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]
 
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章