【Java每日一題】20161012

package Oct2016;  
  
public class Ques1012 {  
  
    public static void main(String[] args) {  
        System.out.println(new BigDog("大黑狗", "黑色"));  
    }  
}  
  
class Dog{  
  
    String name;  
  
    public Dog(String name) {  
        super();  
        this.name = name;  
    }  
  
    public String toString(){  
        return "name:"+name;  
    }  
}  
  
class BigDog extends Dog{  
  
    String color;  
  
    public BigDog(String name, String color) {  
        this.name = name;  
        this.color = color;  
    }  
  
    public String toString(){  
        return "name:"+name+", color:"+color;  
    }  
}

今日問題:
請問主程序輸出結果是多少?(點擊如下每日一題20161013查看問題解析)java

 

題目原發佈於公衆號、簡書:Java每日一題20161013Java每日一題20161012this

每日一題最新將在公衆號發佈,歡迎訂閱,交流進步code

相關文章
相關標籤/搜索