Honesty Rocks! truth rules.

Java Object[][] Help

HOME      >>       Programming

sonesay

I'm having some issues with working with objects [][]. I get an index out of bounds ex.Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException: 0heres how I'm using it----------------------------Object[][] contestants = new Object[][] {};contestants[0][0] = "test";any ideas appreciated. Do I need to specify the initial size on creation or something?It seems I answered my own question I gave it an inital size then I was able to add things. But is there a way I can add to it on the fly without knowing its require maximum size?


EpicRevolution

I think what your trying to do is to big to handle or somewhere in your coding process you must of forgot something and it compiled


sonesay

I found the error a little after I made the initial post. It was because I did not give the array an initial max size so it wouldn't let me use it. Thanks for your input none the less.