title: Changing an integer in Java
body: <p>I Know that in Java, Integer is an immutable object. but I need a way to be able to change an integer in a method and see the change outside the method.
  For example:</p>
  
  <pre><code>int getInt(){
      int my_int=0;
      test(my_int);
  }
  
  void test(int i){
      i=3;
  }
  </code></pre>
  
  <p>What I want to see as the output of <code>getInt</code> is <code>3</code> not <code>0</code>.
  Is there any way to do that?</p>
  
  <p>my method is more complicated than what I wrote, and it will return another object. That's why I want to change the int in the input and not return it.</p>