Im having some issues sorting a ArrayList that contains ArrayLists
ArrayList<ArrayList<String>> multiMarkArray = new ArrayList<ArrayList<String>>();
String line;
while ((line = bufRdr.readLine()) != null) {
ArrayList<String> singleMarkArray = new ArrayList<String>();
for (String word : line.split(" ")) {
singleMarkArray.add(word);
}
Collections.swap(singleMarkArray, 0, 1);
multiMarkArray.add(singleMarkArray);
}
Collections.sort(multiMarkArray);
System.out.println(multiMarkArray);
Im getting the error Collections cannot be applied to (java.util.ArrayList>)
Can someone point me in the right direction to solving this issue?
Thanks