-->
当前位置:首页 > 题库

单选题:The result to compile and run the code below is:

Luz5年前 (2021-05-10)题库1462
The result to compile and run the code below is: @[A](2)
```Java
public class Ref {
public static void main(String[] args){
Ref r = new Ref();
r.amethod(r);
}
public void amethod(Ref r){
int i = 99;
multi(r);
System.out.println(i);
}
public void multi(Ref r){
r.i = r.i * 2;
}}
```

A. Compile fails.
B. Prints: 99
C. Prints: 198
D. Run-time error.



A.Compile fails.
B.Prints: 99
C.Prints: 198
D.Run-time error.


答案:A