现有:class Rectangle {public static void main(String[] args) {int[] x = { 1, 2, 3 };x[1] = (x[1] > 1) ? x[2] : 0;System.out.println(x[1]);}}结果为:
A. 3
B. 2
C. 1
D. 0
int index=1;int foo[]=new int[3];int bar=foo[index];int baz=bar+index;经过以上代码后,baz的值是多少?( )
A. baz值为 0
B. baz值为1
C. baz值为2
D. 程序运行时抛出异常
E. 代码不能编译
数组定义int[][]num={{7,8,1,2,3,4},{9,10,11,12,30,50,60},{16,20,70},{0}};,则num.length的值为()
A. 3
B. 4
C. 6
D. 7
设有数组定义int[][] x={{9, 5, 3},{9, 4, 5},{6},{7}},则x.length的值为()
A. 3
B. 4
C. 6
D. 7