Is it possible to declare an array of type String[] array.
I think not, so how you go about it?
I have a for loop in which each iteration returns another array of String type. So that i need to store all those arrays.
EDIT:
Can someone tell me how to print out a two dimensional string array.
The problem is Array[i][j], now here "i" is fixed but "j" keeps changing dpeneding upon the size of array returned in above method.
So how can i proceed further. Any simple printing idea would be a great help.
EDIT:
How can i get the size of [j] index. Array.length; returns the size of [i] index.
EDIT:
Here is how i did it:
for (int i=0; i< files.length; i++){
for (int j=0; j<files[i].length; j++){
System.out.println("["+i+"]["+j+"] = "+ files[i][j]);
}
}
}
String[]in aString[][]may have its own, separate length.String[]in aString[][]may have its own, separate length". That is why, "in each iteration, [you] can useArray[i].length" to get the length of thatString[]. I know exactly what I'm talking about, and your time was very well spent, as you figured out what to do. Your terminology was simply a bit off. BTW, NullPointerExceptions have nothing to do with the problem of figuring out how long each row is. They came about because aString[][]holdsString[]objects, and aString[]can be null, andx[i]is invalid whenxis null.