Why doesn't the following works as pass by reference in JAVA although we know that the class varibles are passed by reference to methods?
<pre><code>class a

{ 

void fun(Integer a,Integer b)

{
   a=a+b;

b=a-b;

a=a-b;

}

public static void main(String ...k)

{

    Integer a=new Integer(10);

    Integer b= new Integer(20);

    new a().fun(a,b);
    System.out.println(a+" "+b);
    }
    }
</code></pre>

<p>o/p:10 20</p>

<p>so no swapping happened</p>
