Java integers Return Strange Result While Compare Two Integers?
<pre><code>    Integer i1= new Integer(9);
    Integer i2= new Integer(9);

    if(i1==i2){
        System.out.println("true");
    }else{
        System.out.println("false");
    }


    int i3=9;
    int i4=9;

    if(i3==i4){
        System.out.println("true");
    }else{
        System.out.println("false");
    }

    if(i3==i2){
        System.out.println("true");
    }else{
        System.out.println("false");
    }
</code></pre>

<p><strong>In Above Code First if-else print false, Why ?.But when second Return true and also third have true.I think wrapper classes(Like double,boolean,char)cant compare True ?</strong>  </p>
