title: function won't change value of variable in java?
body: <p>I know that  everything in java is passed by value but shouldn't the below code print 2 instead of 1. </p>
  
  <p>All I am doing is passing <code>Integer</code> and changing its value. Why is it printing 1 instead of 2 ?   </p>
  
  <pre><code>public static Integer x;
  
  public static void doChange(Integer x) {
      x = 2;
  }
  
  public static void main(String arg[]) {
      x = 1;
      doChange(x);
      System.out.println(x);
  }
  </code></pre>