foreach循环遍历二维数组

public  class array {
    public static void main(String[] args) {
        int[][] arr = {
  {3,4,5},{1,2,3,4,5},{7,8,9}};
        for(int[] i : arr){
            for(int j : i){
                System.out.print(j);
            }
            System.out.println();
        }



    }
}

    原文作者:Ccodegod7
    原文地址: https://blog.csdn.net/Ccodegod7/article/details/125301289
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞