scjp考试准备 - 4 - 关于数组

好吧这道题我丢脸了,竟然做错了。

如下程序的输出结果是:

class Alligator{ 
    public static void main(String[] args){ 
        int[]x[] = {{1,2},{3,4,5},{6,7,8,9}}; 
        int[][]y = x; 
        System.out.print(y[2][1]); 
    } 
}

 

最后输出7。

我是从1开始数的。

posted @ 2014-06-19 16:41  robin·张  阅读(190)  评论(0编辑  收藏  举报