title: How can Java assignment be made to point to an object instead of making a copy?
body: <p>In a class, I have:</p>
  
  <pre><code>private Foo bar;
  public Constructor(Foo bar)
  {
      this.bar = bar;
  }
  </code></pre>
  
  <p>Instead of creating a copy of bar from the object provided in the parameter, is it possible to include a pointer to bar in the constructor such that changing the original bar changes the field in this object?</p>
  
  <p>Another way of putting it:</p>
  
  <pre><code>int x = 7;
  int y = x;
  x = 9;
  System.out.print(y); //Prints 7.
  </code></pre>
  
  <p>It is possible to set it up so that printing y prints 9 instead of 7?</p>