标签:java面试题
1.
public class Test { public static void main(String[] args) { User u = new User("fff"); Test.setUsers(u); System.out.println(u.getName()); } public static void setUsers(User u){ u = null; } } public class User { private String name; public User(String name){ this.name = name; } public String getName() { return name; } public void setName(String name) { this.name = name; } }
好诡异,结果居然是fff
2.更新中..
本文出自 “浪羽清风” 博客,请务必保留此出处http://1145004.blog.51cto.com/1135004/1573846
标签:java面试题
原文地址:http://1145004.blog.51cto.com/1135004/1573846