//first method:: for(int i=0;i<n;i++) System.out.println(Arrays.toString(matrix[i])); //second method:: java.util.stream.IntSteam .range(0,n) .forEach(i->System.out.println(Arrays.toString(matrix[i]))); //code by dungriyal