题目内容

4、数组b的第2个元素表示为()。

A. b[1]
B. b[2]
C. b(1)
D. b(2)

查看答案
更多问题

5、下列语句会造成数组new int[10]越界的是()。

A. a[0] += 9;
B. a[0] +=10;
C. -a[9]
D. for( int i=0; i<=10; i++ ){ a[i]++;}

1、下面正确的数组初始化语句是()。

A. char str[] = "hello";
B. char str[100] = "hello";
C. char str[] = {'h','e','l','l','o'};
D. char str[] = { 'hello' }

2、下列程序段的运行结果是()。int a[][] = {{1,2,3},{4,5,6}};System.out.println( a[1][1] );

A. 3
B. 4
C. 6
D. 5

3、下面创建数组不正确的是()。

A. float[][] f = new float[3][4];
B. float f[] = new float[6];
C. float[][] f = new float[][4];
D. float[][] f = new float[6][];

答案查题题库