Does the "new" keyword change the value of an object reference?
<p>Let's say that I have a bunch of class instances that serve different purposes, so I want to be able to reference them directly by name:</p>

<pre><code>SomeObject aardvark = new SomeObject();
SomeObject llama = new SomeObject();
SomeObject tiger = new SomeObject();
SomeObject chicken = new SomeObject();
</code></pre>

<p>But then I also want an array of them for easy iteration:</p>

<pre><code>SomeObject[] animals = {aardvark, llama, tiger, chicken};
</code></pre>

<p>My question is this.  What happens when I do this:</p>

<pre><code>llama = new SomeObject();
</code></pre>

<p>I'll be creating a totally new llama object.  How does this affect my animals array?  Will it be referencing the NEW llama object, or somehow still referencing a copy of the old one?</p>

<p>I know Java is "pass by value", but I still get confused by stuff like this.  When I use the NEW keyword, does the "value" of that object reference change?  Thanks!</p>
