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

单项选择题

1. public class X { 
2. public static void main (String[]args)   { 
3. int [] a = new int [1] 
4. modify(a); 
5. System.out.printIn(a[0]); 
6. } 
7.   
8. public static void modify (int[] a)  { 
9.   a[0] ++; 
10.    }
11. }      
What is the result?()

    A. The program runs and prints “0”
    B. The program runs and prints “1”
    C. The program runs but aborts with an exception.
    D. An error “possible undefined variable” at line 4 causes compilation to fail.
    E. An error “possible undefined variable” at line 9 causes compilation to fail.

点击查看答案&解析

相关考题

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

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