Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Initialization of array of arrays

 
René Hoielt Hansen
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I have a question regarding initialization of an array of arrays (all_range). I get four arrays returned from a method and I would like to form a "table" by making a array of arrays.



Thanks for any help you could give me.
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24211
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know what your number "3" is supposed to represent, but in fact the correct thing to do is to omit the numbers altogether:

String[][] all_range = new String[][] {range,fo_range,op_range,unix_range};
 
René Hoielt Hansen
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks - it was so simple. I think the 3 is because I borrowed it from C# where syntax is similar but not identical.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic