title: Java autoboxing and comparison of Objects using operators
body: <p>I am trying to understand the behavior of below code when Numerical Comparison Operators are used to compare 2 Integer objects in Java.</p>
  
  <pre><code>    Integer i1 = new Integer(1);
      Integer i2 = new Integer(1);
      System.out.println(i1 == i2);
      System.out.println(i1 &gt; i2);
      System.out.println(i1 &gt;= i2);
  </code></pre>
  
  <p>Output of the above code is :</p>
  
  <pre><code>false
  false
  true
  </code></pre>
  
  <p>I understand what is happening in the 1st case (the comparison of object instance is made thats why it gives false). But why second and third scenario are different and how does it work exactly?</p>