SO for a project I am doing, I would like to be able to create a multidimensional array which would look like:
private static String[][] docArray = new String[6][];
For that array I’d establish something like:
docArray[0].equals(headingValue);
.
.
.
docArray[5].equals(anotherValue);
Then say I want to do something like have index 3 point to a child array, logically I’d think you’d do something like the following (although I know it’s not the correct syntax)…
docArray[3][1] = new String[6][];
So am I correct in my logic thus far, and how do I continue about adding pointers to new arrays? Thanks in advance for any help.
The problem with this is that if
docArrayis aString[][], thendocArray[3][1]should be aString, not aString[][].What you could do is type
docArrayas anObject[][]; this would allow you to do what you want since everyStringis anObjectand a jaggedString[][]array is also anObject.