欢迎来到计算机考试题库网 考试题库官网
全部科目 > Java认证考试 > SCJP程序员认证考试

单项选择题

public class test {  
public static void add3 (Integer i){ 
int val = i.intValue ( );  
val += 3;  
i = new Integer (val);  
 }   
 public static void main (String args [ ] ) 
{ Integer i = new Integer (0);   
add3 (i);  
system.out.printIn (i.intValue ( ) );  
}   
}  
What is the result?()

    A. Compilation will fail.
    B. The program prints “0”.
    C. The program prints “3”.
    D. Compilation will succeed but an exception will be thrown at line 3.

点击查看答案

相关考题