public static void main(String[] args) { String[][][] namelist = { { { "张阳", "李风", "陈飞" }, { "乐乐", "飞飞", "小曼" } }, { { "Jack", "Kimi" }, { "Lucy", "Lily", "Rose" } }, { { "徐璐璐", "陈海" }, { "李丽丽", "陈海清" } } }; for (int i = 0; i < namelist.length; i++) { for (int j = 0; j < namelist[i].length; j++) { for (int k = 0; k < namelist[i][j].length; k++) { System.out.println("namelist[" + i + "][" + j + "][" + k + "]=" + namelist[i][j][k]); } } } }执行上述代码,输出结果如下所示。
namelist[0][0][0]=张阳 namelist[0][0][1]=李风 namelist[0][0][2]=陈飞 namelist[0][1][0]=乐乐 namelist[0][1][1]=飞飞 namelist[0][1][2]=小曼 namelist[1][0][0]=Jack namelist[1][0][1]=Kimi namelist[1][1][0]=Lucy namelist[1][1][1]=Lily namelist[1][1][2]=Rose namelist[2][0][0]=徐璐璐 namelist[2][0][1]=陈海 namelist[2][1][0]=李丽丽 namelist[2][1][1]=陈海清
本文链接:http://task.lmcjl.com/news/4706.html