title: How to switch two columns in a 2 dimensional array?
body: <p>I am writing a Sudoku code in Java. </p>
  
  <p>I already wrote a code, but instead of columns, rows are switched!</p>
  
  <pre><code>int[] tempField = array2D[myFirstCol_toSwitch];
  array2D[myFirstCol_toSwitch] = array2D[mySecondCol_toSwitch];
  array2D[mySecondCol_toSwitch] = tempField;
  </code></pre>
  
  <p>In order to generate a Sudoku board I need to swap columns randomly.</p>