Jump to content
xisto Community
Sign in to follow this  
sonesay

Java Object[][] Help

Recommended Posts

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?

Edited by sonesay (see edit history)

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.