public class Test {
public static void main(String[] args) {
String n = 3;
System.out.println("Before change, n = " + n);
changeData(n);
System.out.println("After changeData(n), n = " + n);
}
public static void changeData(String nn) {
nn = 10;
}
} 结果为:
Before change, n = 3
After changeData(n), n = 3
问:为什么是怎样的转出结果能给我详细讲解一下吗?实际上我对对象在内存中的建立引用问题还是不是很清楚。希望指点迷津
|
|