【Java每日一题】20161012

时间:2021-02-20 16:25:12
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每日一题20161013Java每日一题20161012

每日一题最新将在公众号发布,欢迎订阅,交流进步