What will the following method output when called with a 2D array?
public static void printDiagonal(int[][] matrix) {
for (int i = 0; i < matrix.length; i++) {
System.out.print(matrix[i][i] + " ");
}
}
public static void main(String[] args) {
int[][] array = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}};
printDiagonal(array);
}