Hi,
I need to put data from a file into several ArrayList.
But the number of ArrayList is not known
Can i create an ArrayList in witch i put ArrayList<String> ?
If yes, how do i do that ?
Kind regards
Dipke
Printable View
Hi,
I need to put data from a file into several ArrayList.
But the number of ArrayList is not known
Can i create an ArrayList in witch i put ArrayList<String> ?
If yes, how do i do that ?
Kind regards
Dipke
Code:ArrayList<String> s = new ArrayList<String>();
s.add("test");
ArrayList<ArrayList> a = new ArrayList<ArrayList>();
a.add(s);
Thanks,
Just what i am looking for
is better, otherwise 'a' is ArrayList<ArrayList<?>>, which I think only have disadvantages over ArrayList<ArrayList<Object>>.Code:ArrayList<String> s = new ArrayList<String>();
s.add("test");
ArrayList<ArrayList<String>> a = new ArrayList<ArrayList<String>>();
a.add(s);
Hello,
I had already triedbur each time i had an arror.Code:ArrayList<ArrayList<String>> a
Now it is working, so that means that i made a syntax error when trying.
Many thanks to all and a happy newyear.
Dipke