Initializing a Two Dimensional Array

//A two dimensional array of int values is initialized, and the element
//at [0][2] is displayed.
public class Test2Darray {
public static void main(String args[]) {
int[][] multiD = {
{ 1, 2, 3, 4 },
{ 5, 6, 7 }
};
System.out.println("The element at [0][2] is " + multiD[0][2]);
}
}
Related examples in the same category