HOME       >>       Programming

Java Object[][] Help


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.



VIEW DESKTOP VERSION REGISTERGET FREE HOSTING

Xisto.com offers Free Web Hosting to its Members for their participation in this Community. We moderate all content posted here but we cannot warrant full correctness of all content. While using this site, you agree to have read and accepted our terms of use, cookie and privacy policy. Copyright 2001-2019 by Xisto Corporation. All Rights Reserved.