Not sure if this is commonly used, because I have seen Array grid.
List<Object> LL1 = new ArrayList<>(Arrays.asList(1, 2));
List<Object> LL2 = new ArrayList<>(Arrays.asList(4, 5, 6));
List<Object> LL3 = new ArrayList<>(Arrays.asList(7, 8, 9));
List<Object> Lgrid = new ArrayList<>(Arrays.asList(LL1, LL2, LL3));
System.out.println(Lgrid); // >>> [[1, 2], [4, 5, 6], [7, 8, 9]]
So I create a ArrayList grid, no problem. Now, if I want to add a value into 1st element of the grid, (LL1).
// I can:
LL1.add(3);
// But I can't:
Lgrid.get(0).add(3);
I believe if it is an Array grid, I can do this, at least edit by calling Array[0][0] = newValue
.
Is there anyway for me to just handle things from the grid?
Thanks!
`, that still uses raw types. Use `List
– Tom Mar 07 '19 at 21:42>` and always add the _correct_ generic types, not just half and not just `