2. public static void main(String[] args){
3. int[]x[] = {{1,2},{3,4,5},{6,7,8,9}};
4. int[][]y = x;
5. System.out.print(y[2][1]);
6. }
7. }
What is the result?
A. 2
B. 3
C. 4
D. 6
E. 7
F. Compilation fails.
----------------------------------------------------------------
答案:E
class test11{
public static void main(String[] args){
int[]x[] = {{1,2},{3,4,5},{6,7,8,9}};
int[][]y = x;
for (int i=0;i
}
System.out.println();
}
System.out.println(y[2][1]);
}
}
ANS:
E. 7
-----------------------------------------------------------------------------
參考輸出如下
12
345
6789
沒有留言:
張貼留言