An object is only once in memory. Your first addition to list
just adds the object references.
anotherList.addAll
will also just add the references. So still only 100 objects in memory.
If you change list
by adding/removing elements, anotherList
won't be changed. But if you change any object in list
, then it's content will be also changed, when accessing it from anotherList
, because the same reference is being pointed to from both lists.