title: Java: How to get address of array?
body: <p>I am trying to convert a C++ code to Java.
  The C++ code snippet is: <code>findMedian(array+left+i*5, 5);</code>.</p>
  
  <p>The parameter passed is the array address which changes according to the value of i. How can I modify this code so that it works in Java?The method is as below:</p>
  
  <pre><code>public int findMedian(int arr[], int n)
  {
      Arrays.sort(arr);
      return arr[n/2]; // Return middle element
  }
  </code></pre>