Passing references type variable as method parameter
<p>After running the code below I get this output:
Eve
1200</p>

<p>Could anyone explain me why the value of Person type variable is being changed and value of Integer type variable is not? 
I have already read this:</p>

<ol>
<li>www.javaworld.com/javaworld/javaqa/2000-05/03-qa-0526-pass.html</li>
<li>www.yoda.arachsys.com/java/passing.html#formal</li>
</ol>

<p>but I don't get why with Person and Integer types it works different.</p>

<pre><code>public class Test {
    public static void main(String[] args) {
        Object person = new Person("Adam");
        Object integer = new Integer("1200");

        changePerson(person);
        changeInteger(integer);

        System.out.println(person);
        System.out.println(integer);
    }

    private static void changeInteger(Object integer) {
        integer = 1000;
    }

    private static void changePerson(Object person) {
        ((Person)person).name="Eve"; 
    }
}
</code></pre>
