how to you write a method in java to alphabetize names?

Rishi S

New member
this is what i have to sort grades...

public static void sortSelection(int grades[]){
for (int i = 0; i < grades.length -1; i++){
int largest = i;
for (int c = largest + 1; c < grades.length; c++)
if (grades[c]> grades[largest]) largest = c;
int temp = grades[largest];
grades[largest]= grades;
grades= temp;

}
}

i need to use the same kind of format but instead alphabetize the names...
 
Back
Top