Java - Object properties does not differ
<pre><code>ClassName ref = new ClassName();
ref.setCredentials(Credentials);
ref.setVal(value);
ref.setUser(user);
</code></pre>

<p>Now when I create a new object of the same class reference, I still get the previous values I have set. Why is this so?</p>

<pre><code>ClassName ref2 = new ClassName();
ref2.setVal(value);
ref2.setUser(user);
ref2.setSomethingNew(somethingNew);
</code></pre>

<p>My <code>ref</code> and <code>ref2</code> instances have all the values [<code>Credentials, Value, User and SomethingNew</code>]. I want to differentiate these two instances. Is it because it's holding the same object?</p>

<p><strong>Update My Lapse:</strong></p>

<p>It's actually <code>ref2</code> and not <code>ref</code>. I get the values in <code>ref2</code> which i am not setting, and <code>ref</code> too holds a value which I am setting in the instance of <code>ref2</code>. Both are in same context.</p>
