• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

"Multi-Dimensional" Arrays

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I will need at least a "3-dimensional" array in order to create multiple "series" to be charted on an xy line graph. I understand the limitations of Java and that one can only create "an array of arrays". How do I "redimension" or re-instate an array to hold more entries?

Could someone provide me with a good example of creating a "multi-dimensional array" (3 dimensional would be quite useful!). Things in VB always seemed a little more straightforward...
 
Bartender
Posts: 4568
9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you want to be able to be able to change the sizes, you really want to be using Lists rather than arrays.

You could use Lists of Lists, but I'd actually suggest creating a Series class, and using a List<Series>. The Series could then contain arrays or Lists as appropriate.
 
lowercase baba
Posts: 13089
67
Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
one of the limitations of arrays is that you cannot re-size them. The best you can do is create a bigger one, copy the data from the smaller to the larger, then forget about the smaller one.
 
It means our mission is in jeapordy! Quick, read this tiny ad!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic