class ValHold {
public int i = 10;
}
public class Java_class {
public static void main(String[] args) {
Java_class jc=new Java_class();
jc.amethod();
}
public void amethod() {
int i=99;
ValHold v=new ValHold();
v.i=30;
another(v, i);
System.out.println(v.i);
}
public void another(ValHold v,int i) {
i=0;
v.i=20;
ValHold vh=new ValHold();
v=vh;
System.out.print(v.i+" "+i+" ");
}
}
【java选修】修改堆/栈中的值
最新推荐文章于 2022-08-02 00:07:13 发布