public static void idNumberSort(String[] array) { int startScan, index, maxIndex, maxValue; for (startScan = 0; startScan < (array.length-1); startScan++) { maxIndex = startScan; maxValue = array[startScan]; for(index = startScan + 1; array[index]compareToIgnoreCase(maxValue) > 0; index++) { if (array[index] > maxValue) { maxValue = array[index]; maxIndex = index; } } array[maxIndex] = array[startScan]; array[startScan] = maxValue; } }
I wanted to sort the strings in descending order. My teacher won't let us use the sort method.