title: Java changes reference but not the object itself?
body: <p>Please see the following code:</p>
  
  <pre><code>public static void main(String[] args)
  {
      Test t1 = new Test();
      t1.i = 1;
      Test t0 = t1;
      Test t2 = new Test();
      t2.i = 2;
      t0 = t2; 
      System.out.println(t1.i); //prints 1, I thought it would print 2
  }
  </code></pre>
  
  <p>Is there any way to change t1 object after I got it from somewhere else by simple assignment without accessing t1 directly? (i.e. t1 = t0)</p>