以下程序的运行结果为?
class ValHold{
public int i = 10;
}
public class ObParm{
public static void main(String argv()){
ObParm o = new ObParm();
o.amethod();
}
public void amethod(){
int i = 99;
ValHold v = new ValHold();
v.i=30;
another(v,i);
System.out.print( 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);
System.out.print(i);
}
}
A.10030
B. 20030
C. 209930
D. 10020
答案说明:本题目答案来自网络整理或转载,最终答案请以官网为准。
答 案:D