title: object a = object b; what happens to object a?
body: <p>One of my professor has given us a few practice questions for an exam, and one of the questions is something like the below (psuedocode):</p>
  
  <pre><code>a.setColor(blue);
  b.setColor(red);
  a = b;
  b.setColor(purple);
  b = a;
  //what color is a, and what color is b?
  </code></pre>
  
  <p>It seems extremely rudimentary to me, so I've proposed the answer that a is 'red', and b is 'red', but I've been told this is incorrect. I've broken down my answer as I would a math problem:</p>
  
  <pre><code>a = 15;
  b = 12;
  a = b; //a becomes 12
  b = 13;
  b = a; //b becomes 12
  </code></pre>
  
  <p>But my thought process is through the mind of C, not Java. I figured there was some universal method for both, but perhaps I am wrong? Is my answer wrong or my professor is wrong? I'm very new to Java, although I have some command of C, Python, and web logic (PHP, Ruby), so I apologize if this is something trivial (which it is).</p>