![]() |
#2
nuimqi2007-11-01 01:23
|
class Test{
public int i=10;
}
public class ObParm{
public static void main(String argv[]){
int i = 100;
Test v = new Test();
Test vh=new Test();
ObParm o=new ObParm();
o.amethod();
System.out.println(v.i+" "+i);
System.out.println(vh.i);
}
public void amethod(){
int i=99;
Test v=new Test();
v.i=30;
Test vh=new Test();
vh.i=50;
another(vh,i);
System.out.println(v.i+" "+i);
System.out.println(vh.i);
}
public void another(Test v, int i){
i=0;
v.i=20;
Test vh=new Test();
v=vh;
System.out.println(v.i+" "+i);
}
}
大家说说结果会是多少?