title: Efficient swapping of elements of an array in Java
body: <p>I am wondering if there is a more efficient way of swapping two elements in an Array, than doing something like this:</p>
  
  <pre><code>String temp = arr[1];
  arr[1] = arr[2];
  arr[2] = temp;
  </code></pre>
  
  <p>Well, this is obviously not bad or even wrong, but I need to swap very often so I am interested if there are any Libs or something that provide a more efficient way to do this?</p>