欢迎来到易学考试网 易学考试官网
全部科目 > Java认证考试 > SCJP程序员认证考试

单项选择题

1. public class Boxer1 { 
2. Integer i; 
3. int x; 
4. public Boxer1(int y) { 
5. x=i+y; 
6. System.out.println(x); 
7. } 
8. public static void main(String[] args) { 
9. new Boxer1(new Integer(4)); 
10. } 
11. } 
What is the result?() 

    A. The value “4” is printed at the command line.
    B. Compilation fails because of an error in line 5.
    C. Compilation fails because of an error in line 9.
    D. A NullPointerException occurs at runtime.
    E. A NumberFormatException occurs at runtime.
    F. An IllegalStateException occurs at runtime.

点击查看答案&解析

相关考题

微信小程序免费搜题
微信扫一扫,加关注免费搜题

微信扫一扫,加关注免费搜题