• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

Regd Multidimensional arrays/collections  RSS feed

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi How can I store arrays in a java collection
I mean I have lets say three string arrays
String [] one = {"a" , "b"};
String [] two = {"c" , "d"};
String [] three = {"e" , "f"};
Now I want to store this array in some java collection
so that I can iterate thru this and pass these arrays as arguments
ex : for(int i=0;i<collectionArray;i++)>
{
callFunction(collectionArray[i]);
}
I am somehow not able to do this.
how do I do this.

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Make a Vector() and add these array objects into it !
 
author
Posts: 3252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Better even, make an ArrayList(), LinkedList(), HashSet(), or TreeSet()...
- Peter
 
Bartender
Posts: 783
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
jha0147/Nirvana_417,
Please change your name to be compliant with JavaRanch's naming policy. Your ID should be 2 separate names with more than 1 letter each. We really want this to be a professional forum and would prefer that you use your REAL name.
Thanks,
-Peter
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!