Example 3: PrintArray
class PrintArray {
public static void main(String[] args){
int[][] a = new int[][]{{1,2,3}, {4,5,6}, {7,8,9}};
for (int i=0; i<a.length; i++){
for (int j=0; j< a[0].length; j++){
System.out.print(a[i][j]+" ");
}
System.out.println();
}
}
}
Previous slide
Next slide
Back to first slide
View graphic version