public static void main(String[] args){
// foreach 遍历二维数组
int [][]nums={{1,2,3},{4,5,6},{7,8,9}};
for(int[]i:nums){
for(int j:i){
System.out.print(j);
}
System.out.println();
}
}
原文链接:https://blog.csdn.net/skylibiao/article/details/81165224