title: Java sorting parallel arrays
body: <p>I have to sort a database of 1 string array and 2 int arrays. This is what I have so far:</p>
  
  <pre><code>public static void sortDatabase(int numRecords, String[] sDeptArr, 
                int[] iCourseNumArr, int[] iEnrollmentArr)
     {
         int length = sDeptArr.length;
         for(int i=0; i&lt;length-1; i++)
         {
             int iPosMin = i;
             for(int j=i+1; j&lt;length; j++)
             {
                 if(sDeptArr[j].compareTo(sDeptArr[iPosMin]) == 0)
                     iPosMin = j;
                 else if(sDeptArr[j].equals(sDeptArr[iPosMin]) &amp;&amp; iCourseNumArr[j] &lt; iCourseNumArr[iPosMin])
                     iPosMin = j;
             }
         }
     }
  </code></pre>
  
  <p>I have yet to test it because the entire program is not done but does this look like it is going in the right direction? I want to sort the database in alphabetical order by name first, then if the names are the same, use the course number to sort.</p>