以下输出是什么 ?class TestIt{ public static void main ( String[] args ) { int[] myArray = {1, 2, 3, 4, 5}; ChangeIt.doIt( myArray ); for(int j=0; j<myArray.length; j++) System.out.print( myArray[j] + " " ); }}class ChangeIt{ static void doIt( int[] z ) { z = null ; }}
(A)1 2 3 4 5
(B)什么都不会打印出来
(C)程序将因运行时错误而停止
(D)0 0 0 0 0
参考答案
继续答题:下一题


更多java基础知识试题
- 1下列关于异常的说法,不正确的是?
- 2以下哪个类可以访问所有(子类与超类)的 public 和 protected 方法 ?
- 3以下是文件HELLO.java中的源代码,请分析该代码的运行结果public class Hello{public static void main(String[] args){String str = "Hello World";System.out.print(str);}}
- 4给定以下程序段,如下:int i=0,j=-1;switch(i){case 0:j=1;case 2:j=2;default:j=5;}System.out.print("j="+j); 编译运行,正确的是
- 5使用Java IO流实现对文本文件的读写过程中,需要处理下列( )异常