public class TestB {
public static void main(String[] args) {
TestB b = new TestB();
System.out.println(b.number);
testChange(b);
System.out.println(b.number);
}
b= new TestB();
b.number = 6;
return b;
}
}
输出结果 :本想是3,6,但结果是 3,3 本质:java 引用传递的是 引用地址的拷贝