This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Soft Skills: The software developer's life manual and have John Sonmez on-line!
See this thread for details.
Win a copy of Soft Skills: The software developer's life manual this week in the Jobs Discussion forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Array of ArrayLists Possible?

 
Jonathan Night
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to make an Array of ArrayLists...
Since I have 3 ArrayLists I want to make I thought it would be something like this...

ArrayList [] ReadyList = new ArrayList[3]();

So that I can make calls like this:

ReadyList[0].get(x);
or ReadyList[1].get(x);
or ReadyList[2].get(x);

If you're curious, the 3 arrays are supposed to represent events of priority 0, 1, and 2. If you know how I can do this I would really appreciate it. Thanks a bunch!
 
Michael Dunn
Ranch Hand
Posts: 4632
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Jonathan Night
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a bunch! Worked like a charm... Now I just gotta deal with Java.lang.StackOverflowError... Possibly the greater of the two evils...
 
Tony Morris
Ranch Hand
Posts: 1608
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Better still, use List reference types:

 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic