下面代码的输出结果是:int[] testScores = {80, 63, 99, 87,100};System.out.println("Length: " + testScores.length);
A. Length: 4
B. Length: 5
C. Length: 100
D. 产生编译错误
查看答案
下面声明那个会产生编译错误:
A. double[][] numbers = {{1,2,3},{7,8},{4,5,6,9}};
B. double[][] numbers = new double[7][];
C. double[][] numbers = new double[][];
D. double[][] numbers = new double[7][3];
下面代码运行后,变量sum的值是多少int[][] square = new int[3][3];for(int i=0;i<3;i++){square[i][i] =5;}int sum =0;for(int i=0;i<3;i++){for(int j=0;j<3;j++){sum += square[i][j] ;}}
A. 10
B. 15
C. 20
D. 25
下列程序段的运行结果为int [][]x ={{1,2},{3,4,5},{6,7,8,9}};int[][]y = x;System.out.println(y[2][1]);
A. 3
B. 4
C. 6
D. 7
选择声明并创建数组的正确形式
A. int[] array;array[] = new int[15];
B. int[] array;array = new int[15];
C. int[15] array = new int[];
D. int[] array = new int[];