黑马程序员技术交流社区

标题: 遍历二维数组 [打印本页]

作者: 月影千华    时间: 2015-10-4 13:30
标题: 遍历二维数组
  1. public class ForDemo {
  2.     public static void main(String[] args) {
  3.         int[][] arr = { { 3, 1, 5 }, { 4, 3, 8 }, { 7, 34, 12, 5 } };
  4.         for (int[] i : arr) {
  5.             for (int j : i)
  6.                 System.out.println(j);
  7.         }
  8.     }
  9. }<p></p>
复制代码
遍历二维数组.





欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/) 黑马程序员IT技术论坛 X3.2