Java每日一题20170111
2017-01-11 本文已影响27人
weknow
20170110问题解析请点击今日问题下方的“【Java每日一题】20170111”查看(问题解析在公众号首发,公众号ID:weknow619)
package Jan2017;
public class Ques0111 {
public static void main(String[] args) {
final Person p1 = new Person("张三");
final Person p2 = new Person("李四");
p1 = new Person("王五");
p2.setName("王五");
}
}
class Person{
private String name;
Person(String name) {
this.name = name;
}
public void setName(String name) {
this.name = name;
}
}
今日问题:
请问主程序有无编译错误?(点击以下“【Java每日一题】20170111”查看20170110问题解析)
注:weknow团队近期开通并认证了分答,欢迎大家收听,有问题也欢迎到分答来咨询哦,回见您!!
748537-87e51eb28fe0b746.png