✏️ Explanatory Question
Given the following 2D array:
int[][] matrix = { {5, 8, 3}, {4, 9, 7}, {6, 2, 1} };
Write a program to display the element at the second row, third column.
Given the following 2D array:
int[][] matrix = { {5, 8, 3}, {4, 9, 7}, {6, 2, 1} };
Write a program to display the element at the second row, third column.
public class Main {
public static void main(String[] args) {
int[][] matrix = {
{5, 8, 3},
{4, 9, 7},
{6, 2, 1}
};
System.out.println("Element at 2nd row, 3rd column: " + matrix[1][2]);
}
}