So, I have this use case:
ArrayList<String> test1 = new ArrayList<String>();
test1.add("string1");
test1.add("string2");
ArrayList<String> test2 = test1;
test2.remove(0);
System.out.println(test1.get(0)); // Expect to see "string1"
The first ArrayList test1, has two String elements. Then I make a new (?) ArrayList, test2, which is the same as test1. When I remove the first element from test2 (which is "string1") and then try to display the first element from test1, it returns "string2"... also there the first element "string1" is removed somehow.
How is that possible?