1
public class test {
public static void main(String[] args) {
A a = new A();
System.out.println(a.v);// 0
setValue(a);
System.out.println(a.v);// 1
setA(a);
System.out.println(a.v);// 1
}
public static void setValue(A a) {
a.v = 1;
}
public static void setA(A a1) {
a1 = new A();
}
}
class A {
int v = 0;
}