title: Java Sorting columns in 2D Array of Strings
body: <p>I have been working off of <a href="https://stackoverflow.com/questions/4907683/sort-a-two-dimensional-array-based-on-one-column">this SO question</a>. However, my data is arranged slightly differently. </p>
  
  <p>Without going into <strong>HOW</strong> the data is retrieved, suffice it to say the resulting array looks like this</p>
  
  <pre><code>String[2][]
      [0] = String[4]
      [1] = String[4]
  </code></pre>
  
  <p>The actual data, then is as follows</p>
  
  <pre><code>data = String[2][]
    data[0]
      data[0][0] = "Columbia"
      data[0][1] = "Chile"
      data[0][2] = "Asia"
      data[0][3] = "US"
    data[1]
      data[1][0] = "B216"
      data[1][1] = "B217"
      data[1][2] = "A442"
      data[1][3] = "N665"
  </code></pre>
  
  <p>I want to sort the entire array by data[0] in alphabetical order. Yet I realized that the solution provided in the referenced SO question is working off of a different array format.</p>
  
  <p>My expected result would look like</p>
  
  <pre><code>data = String[2][]
    data[0]
      data[0][0] = "Asia"
      data[0][1] = "Chile"
      data[0][2] = "Columbia"
      data[0][3] = "US"
    data[1]
      data[1][0] = "A442"
      data[1][1] = "B217"
      data[1][2] = "B216"
      data[1][3] = "N665"
  </code></pre>
  
  <p>I'm not entirely certain how to obtain these results without iterating over each element and shifting them to a new array.</p>
  
  <p>Any ideas?</p>