title: Object References In Java
body: <p>Object references in java really confuse me. And when I started to study linkedlist, I realized that I know verry little about the subject. My question is</p>
  
  <pre><code>Node node = list; 
  </code></pre>
  
  <p>Let's say list is the first node in my linkedlist and I know that this operation means that node refers to the same object that the list refers to. I mean, if I make changes to the node, consequently to the object that it refers to, list will be also affected by these changes. However, what I don't understand that do node.next and list.next also refer to the same object. I mean if I wrote the linkedlist like</p>
  
  <pre><code>Node node = list;
  node = node.next;
  </code></pre>
  
  <p>Does that mean I am also changing list with the list.next? Or if I write (node.next.name = "B"), do I also change the name of the list.next element?. I know the questions seems silly but I really don't know anything about references. And I also researched the subject a lot. But what I found online so far, they didn't help me much. If someone explains it to me in a clear and comprehensible way, I would be very appreciated. </p>