Integer and int duality?
<p>Can someone explain me this </p>

<pre><code> List&lt;Integer&gt; list = new LinkedList&lt;Integer&gt;();
 list.add(2);
 list.add(1);
 list.add(3);
</code></pre>

<p>when I used</p>

<pre><code> list.remove(1);
</code></pre>

<p>then 1st element got removed</p>

<pre><code> list.remove(new Integer("1"));
</code></pre>

<p>then 2nd element got removed.</p>

<p>so, can you explain behavior of auto boxing and unboxing in above senario</p>

<p>when <code>new A().a(new Integer("1"));</code></p>

<p>executed on, </p>

<pre><code>public class A {
    public void test(Integer i) {} //1
    public void test(int i) {} //2
    public void test(Object o) {}//3
} 
</code></pre>

<p>method 1 go executed</p>

<pre><code>public class A {
    public void test(int i) {} //2
    public void test(Object o) {}//3
} 
</code></pre>

<p>method 3 got executed</p>
