fadden, it turns out the issue is with creating the array in a
different class. That is why your test program worked, because you
didn't actually recreate the situation I explained. I hope that this
helps anyone with the same issue that is looking for an answer.

On Feb 17, 8:16 pm, fadden <[email protected]> wrote:
> On Feb 17, 5:34 pm, Jeffrey <[email protected]> wrote:
>
> > I have a 2D array that I need to initialize. I have a class that holds
> > all my variables name "V", so in that class I have this:
>
> > static String[][] ModelInfo = new String[300][25];
>
> > That should make 300 array variables with 25 points in it, but it
> > doesn't as any time I try to reference anything other than
> > V.ModelInfo[0][0] I get arrayindexoutofboundsexception.
>
> I tried a test program:
>
>     public static void main(String[] args) {
>         String[][] ModelInfo = new String[300][25];
>
>         System.out.println(ModelInfo);
>         System.out.println(ModelInfo[200]);
>         System.out.println(ModelInfo[200][10]);
>     }
>
> it output something like:
>
> [[Ljava.lang.String;@4aad3ba4
> [Ljava.lang.String;@3326b249
> null
>
> This seems to be the expected behavior - an array with 300 entries,
> each of which is an array with 25 entries, ready to hold strings.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to