20170109问题解析请点击今日问题下方的“【Java每日一题】20170110”查看
package Jan2017;
public class Ques0110{
public static void main(String[] args){
Person person = new Person("张三");
System.out.println("修改之前 " + person);
Ques0110.update(person);
System.out.println("修改之后 " + person);
}
public static void update(Person person){
person = new Person("李四");
}
}
class Person{
String name;
Person(String name){
this.name = name;
}
public String toString(){
return "name: " + name;
}
}
今日问题:
请问主程序修改后输出结果是?(点击以下“【Java每日一题】20170110”查看20170109问题解析)
题目原发布于公众号、简书:【Java每日一题】20170110,【Java每日一题】20170110 (也可以扫描头像二维码查看)