Welcome Guest ( Log In | Register)



 
Reply to this topicStart new topic
> Java Object[][] Help
sonesay
post May 27 2008, 10:49 AM
Post #1


|||[ n00b King ]|||
*********

Group: [HOSTED]
Posts: 685
Joined: 20-June 07
From: Auckland
Member No.: 45,102



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: 0

heres 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?

This post has been edited by sonesay: May 27 2008, 10:58 AM
Go to the top of the page
 
+Quote Post
EpicRevolution
post Jul 8 2008, 01:06 AM
Post #2


Newbie [Level 1]
*

Group: Members
Posts: 10
Joined: 7-July 08
Member No.: 64,709



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
Go to the top of the page
 
+Quote Post
sonesay
post Jul 8 2008, 02:16 AM
Post #3


|||[ n00b King ]|||
*********

Group: [HOSTED]
Posts: 685
Joined: 20-June 07
From: Auckland
Member No.: 45,102



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.
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Java editor(72)
  2. Auto Run Java Program(11)
  3. Java Script Drop Down Menu With Css(2)
  4. [help] Java Script: Window.open(10)
  5. Java Mobile Applications(7)
  6. How To Create Java Button Or Frame(14)
  7. Java Basic Program Guidance(6)
  8. Java Helpdesk(8)
  9. Problem With Java Script Popup Form(1)
  10. Best Java Framework For J2ee?(6)
  11. The Power Of Java(14)
  12. Jsp Or Java Chat Script Like Mig33(5)
  13. Helpful Registry Edit For Java Programmers(3)
  14. Java Iterator Help(2)
  15. Beginning Java(10)
  1. Java In A High School Software Design Course(5)
  2. Circular Movment/animation In Java?(6)
  3. Java Applet Query(1)
  4. Java Or C++(10)
  5. Java Vs Javascript(11)
  6. Learn Java Programming Language Online Step By Step(1)
  7. Java Game(2)
  8. Call Pdf995 From Java(0)
  9. How To Implement Single Instance Application On Java(0)
  10. Java Multithreading Issues(2)
  11. Java And Xml: Links You Must Have(1)
  12. Which Is Good Java Or Dot Net(3)
  13. Java Script To Hide The Url In Address Bar(6)


 



- Lo-Fi Version Time is now: 11th October 2008 - 02:55 AM