title: pass by reference an integer in java
body: <p>I need to pass an integer by reference in java . Is there a simple way to do so ? In C++ by putting "&amp;" before an integer would be passed by reference . 
  This is the C code that I'm trying to turn to Java :</p>
  
  <pre><code>void count(int distance, int i, int &amp;counter, int array[], int n) {
      if (i == distance) 
          counter++;
      else {
          for (int j = 0; j &lt; n; j++) {
              if (i &lt;= distance - array[j]) 
                  count(distance, i + array[j], counter, array, n);
          }
      }
  }
  </code></pre>
  
  <p>Is there a way to do so without having an integer object ?? (I don't want to make another class )</p>