public class TestWS {
public static void main(String args[]) {
Test t = new Test();
t.i = 20;
method(t, t.i);
System.out.println(t.i);
}
public static void method (Test t, int i) {
i = 0;
t.i = 30;
Test tt = new Test();
t = tt;
System.out.println(t.i + " " + i);
}
}
class Test{
int i = 10;
}
打印出的结果是 10 0 30