Then you need a ArrayList
of ArrayLists
:
ArrayList<ArrayList<String>> nodes = new ArrayList<ArrayList<String>>();
ArrayList<String> nodeList = new ArrayList<String>();
nodes.add(nodeList);
Note that NodeList
has been changed to nodeList
. In Java Naming Conventions variables start with a lower case. Classes start with an upper case.