I create method to display element in the 2D array. but I can’t specify the array length for each dimension. this is my code
public static void display2DArray(String[][] array){
for (int i = 1; i < array.length; i++) {
for (int j = 1; j < array.length; j++) {
System.out.println("Document "+i+ " Section "+j);
System.out.println(" "+array[i][j]);
}
System.out.println(" ");
}
}
Please help me.
Try this way