以下代码打印到控制台的数字是多少 ?int[] numbers = {1, 2, 3, 4, 5, 6, 7, 8, 9};for (int i = 0; i < 8; i++) {System.out.print(numbers[i]);}
A. 012346789
B. 012345678
C. 123456789
D. 12345678
查看答案
下列数组定义及赋值,错误的是________。
A. int intArray[];intArray= new int [3];intArray[1] = 1;intArray[2] = 2;intArray[3] = 3;
B. int a[] = {1,2,3,4,5};
C. int a[][]= new int[2][];a[0]= new int [3];a[1]= new int [3];
D. int [] a= {1,2,3,4,5};
下列代码的执行结果是__________。public class Test4_1{public static void main(String args[]){int s=0;int myArray[]= {10,20,30,40,50,60,70,80,90,100};for(int i=0;i
A. 200
B. 250
C. 300
D. 350
关于下面的代码,________是对的。public class Test2{int arr[]=new int[10];public static void main(String args[]){Systme.out.println(arr[1]);}}
A. 编译出错
B. 编译正确,运行出错
C. 输出0
D. 输出null
有整型数组:int[] x = {12,35,8,7,2};则调用方法Arrays.sort(x)后,数组x中的元素依次为:__________.
A. 2,7,8,12,35
B. 12,35,8,7,2
C. 2,7,8,35,12
D. 35,12,8,7,2