Print 2D array using For each loop in Java

import java.util.Scanner;

class ab
{

public static void main(String []args)
{
int [][]arr1 = {{1,2,3},{3,4,3},{5,6,3}};
for(int []a:arr1)
{
for(int b: a)
{
System.out.print(b+" ");
}
System.out.println();
}
}
}