I want to make a method that will create ArrayLists, and name each one after an element in a existing ArrayList.
Like, ArrayList original is (abc, def, ghi, jkl)
and I want the method to create four ArrayLists, named abc, def, ghi, and jkl.
How to pull those strings (abc, def) out and use them to name the new ArrayLists?
I tried:
ArrayList original.get(0) = new ArrayList();
But Eclipse says misplaced construct
I tried:
String newName = original.get(count);
ArrayList (newName) = new ArrayList();
But it says the left hand side of of an assignment must be a variable
If I take the newName out of parenthesis:
String newName = original.get(count);
ArrayList newName = new ArrayList();
It says duplicate local variable newName