I was able to use for loop with int multidimensional arrays but I'm unable to reproduce it with multi arrays.
public class array {
public static void main(String[] args) {
String[][] words = new String[2][3];
words[0][0] = "a";
words[0][1] = "b";
words[0][2] = "c";
words[1][0] = "d";
words[1][1] = "e";
words[1][2] = "f";
}
}
Would love some help on how to iterate that
For reference, this was what I did for int
int[][] multi = {
{3, 4, 5},
{2, 3, 5, 6, 7},
{112, 3}
};
for (int row = 0; row < multi.length; row++) {
for (int col = 0; col < multi[row].length; col++) {
System.out.print(multi[row][col] + " ");
for (String[] word : words) { for (String character : word) {...} }for(int i=0;i<rolSizei++) { for(int j=0;j<colSize;j++) {words[i][j] ...}}