title: create a new Integer object that holds the value 1?
body: <p>To create a new Integer object that holds the value in java 1 which one of the following is right and what exactly is the difference in the following methods as all print the value? </p>
  
  <p>Method 1 : </p>
  
  <pre><code> Integer p = new Integer(1);
  </code></pre>
  
  <p>Method 2 : </p>
  
  <pre><code>Integer p = 1;
  </code></pre>
  
  <p>Method 3 : </p>
  
  <pre><code>Integer p = new Integer("1");
  </code></pre>
  
  <p>Using method three I got the following warning :</p>
  
  <pre><code>Note: HelloWorld.java uses or overrides a deprecated API.
  Note: Recompile with -Xlint:deprecation for details
  </code></pre>