I have a array of ArrayList as defined below.
List<ArrayList<String>> reverseRange = new ArrayList<ArrayList<String>>();
and I set it to:
[[a, b, c, d, e, f, g, h, i], [a, b, c, d, e, f, g, h, i], [a, b, c, d, e, f, g, h, i], [a, b, c, d, e, f, g, h, i], [a, b, c, d, e, f, g, h, i], [a, b, c, d, e, f, g, h, i], [a, b, c, d, e, f, g, h, i], [a, b, c, d, e, f, g, h, i]]
by:
for (int i = 0; i < naive.size(); i++) { reverseRange.add(A); }
where A = [b, c, d, e, f, g, h, i]
I want to delete an object from specific list. Like:
reverseRange.get(0).remove("a");
but when I do that, it removes "a" from all lists and the result becomes:
[[b, c, d, e, f, g, h, i], [b, c, d, e, f, g, h, i], [b, c, d, e, f, g, h, i], [b, c, d, e, f, g, h, i], [b, c, d, e, f, g, h, i], [b, c, d, e, f, g, h, i], [b, c, d, e, f, g, h, i], [b, c, d, e, f, g, h, i]]
What I am doing wrong?