【Java每日一题】20170116

时间:2022-06-24 04:33:25

20170113问题解析请点击今日问题下方的“【Java每日一题】20170116”查看(问题解析在公众号首发,公众号ID:weknow619)

package Jan2017;  

public class Ques0116 {
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;
}
}

今日问题: 
请问主程序输出结果是什么?(点击以下“【Java每日一题】20170116”查看20170113问题解析)

题目原发布于公众号、简书:【Java每日一题】20170116【Java每日一题】20170116 (也可以扫描头像二维码查看)