title: Why does Java create a new object for reference types (e.g Integer)?
body: <p>Maybe a stupid question but I can't see the answer. Let's say we have this simple example:</p>
  
  <pre><code>Integer a = 10;
  a+=4;
  </code></pre>
  
  <p>From what I have read and tried behind the scenes is happening something like this: </p>
  
  <pre><code>Integer a = 10;
  a = new Integer (a+4);
  </code></pre>
  
  <ul>
  <li>Why does Java need to create a new instance and then override the previous reference value with a new one?</li>
  <li>Does Integer (and other reference types variables (Byte, Character)) follow the same principle as <strong>String</strong>s?</li>
  <li>Is not this a performance issue if you want to change the value of a variable and you expect to keep the current reference and to update only the value and what you get is a brand new object?</li>
  <li>Reflect the image below (in big lines) reflect what happens?</li>
  </ul>
  
  <p><a href="https://i.stack.imgur.com/h6HjK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/h6HjK.png" alt="enter image description here"></a></p>