Forums Register Login

Regd Multidimensional arrays/collections

+Pie Number of slices to send: Send
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.

+Pie Number of slices to send: Send
Make a Vector() and add these array objects into it !
+Pie Number of slices to send: Send
Better even, make an ArrayList(), LinkedList(), HashSet(), or TreeSet()...
- Peter
+Pie Number of slices to send: Send
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
It looks like it's time for me to write you a reality check! Or maybe a tiny ad!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 869 times.
Similar Threads
Populate Table Rows With Data from AJAX
An object to hold several arrays
Storing array values to a text file
Error when using java.util.ArrayList
how to combine between two arraylist if has same value
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 08:40:04.