title: Sort array and reflect the changes in another array
body: <p>I have an array of doubles, in Java : <code>arr1</code> which I want to sort. Most probably the first option would be the utility method <code>Arrays.sort(double[])</code>.</p>
  
  <p>The idea is that I want the same changes (e.g. value at <code>index i</code> is interchanged with value at <code>index j</code> in <code>arr1</code>) to be reflected in another array of integers: <code>arr2</code> (in the sense that the values at the same indexes are changed also in <code>arr2</code>). </p>
  
  <p>Is there a simple way (a trick) to accomplish this in Java? Or the only way is to implement the sorting algorithm by myself?</p>
  
  <p><strong>UPDATE</strong>: I see that people recommend replacing the two arrays with one array of objects containing the 2 values (one from <code>arr1</code> and one from <code>arr2</code>). Wouldn't this bring some efficiency penalties. In other words, isn't it less efficient to sort an array of objects than an array of primitive types (doubles in this case) ?</p>
  
  <p>The data is completely static. It's large (it fits in memory) but static.</p>