title: Differences between new Integer(123), Integer.valueOf(123) and just 123
body: <p>Recenlty I saw code (Java) like this:</p>
  
  <pre><code>myMethod(new Integer(123));
  </code></pre>
  
  <p>I am currently refactoring some code, and there is a tip in Sonar tool, that it's more memory friendly to use sth like this:</p>
  
  <pre><code>myMethod(Integer.valueOf(123));
  </code></pre>
  
  <p>However in this case, I think that there is no difference if I would use:</p>
  
  <pre><code>myMethod(123);
  </code></pre>
  
  <p>I could understand that, if I would pass a variable to the method, but hard coded int? Or if there would be Long/Double etc and I want Long representation of number. But integer?</p>