I am trying to get more familiar with java recently. A question occurred to me which I couldn't find the answer online. I am wondering when java adds an element to an arraylist, is the added element associated with a variable name? For example in the following code:
E obj1 = new E();
E obj2 = new E();
List myList = new ArrayList<E>();
myList.add(obj1);
obj1 = obj2;
After the new assignment to obj1 will the value exist in myList change or not?