多做题,通过考试没问题!

Java认证考试

睦霖题库>其他计算机考试>Java认证考试

public class X {   public static void main (Stringargs) {   int a = new int [1]   modify(a);   System.out.printIn(a[0]);   }   public static void modify (int a) {   a[0] ++;    }    }   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
答案解析:
进入题库查看解析

微信扫一扫手机做题