试题详情
单项选择题 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.

  • B
  • 关注下方微信公众号,在线模考后查看

热门试题