title: How to properly update linked list
body: <p>Let's say I have two classes, object1 and object2. I want to add a object1 instance to the end of a linked list in an instance of object2 (that is, the method to add object1 to the linked list is in the object2 class). Supposing the linked list already has one object, why would the following not update my linked list:</p>
  
  <pre><code>object1 a = firstObject1;
  while(a != null) {
      a = a.next;
  }
  a = b;
  </code></pre>
  
  <p>where b is the object with which the adding method is called. To be clear, the issue I'm getting is that when I print the id of every object in the linked list, I don't see the new object.</p>
  
  <p>Note: This is in fact homework, so I can't use helper methods or import libraries.</p>