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
答案解析:有

微信扫一扫手机做题