So I'm trying to create a 2d ArrayList but I'm having some trouble adding one list to another. I found this question that seemed to answer my question but when I try it out myself I get a red warning squiggle under the last add on coordinates.add()
Here's my code
ArrayList<String> coordinates = new ArrayList<String>();
ArrayList<String> buffer = new ArrayList<String>();
buffer.add("123");
buffer.add("abc");
coordinates.add(buffer);
What am I doing wrong here?