I am trying to make a DeleteRecord() that takes any number of String[][] type arguments. I have made a sort of test function just to see what kind of logice iwould need to apply to make that function. I made it work but I want to use a foreach loop. how can I do that. I have this code:
public void testSomething(String[][]... enteredStrings) {
for (int i = 0; i < enteredStrings[0].length; i++) {
for (int j = 0; j < enteredStrings[0][i].length; j++) {
System.out.println("i -> " + i + " " + "j -> " + j + " " + enteredStrings[0][i][j]);
}
}
}
I know how to make foreach loop in java but I can't do it with a multidimensional array. Thanks in advance.
DeleteRecord()), your innermost loop should not be a foreach loop, otherwise the arrays won't be modified.