title: If I have 2 reference types, with the same value, does that mean only 1 object in memory
body: <p>I'm new to Java and have read a conflicting statement to what I believe. Please consider the following code.</p>
  
  <pre><code>String str1 = "dave";
  String str2 = "dave";
  </code></pre>
  
  <p>Both str1 and str2, although unique variables, reference the exact same value. So, how many unique objects are created in memory? 1 or 2 and can some one explain why? </p>