I'd like to have the list be in ascending order via "sortAscending" and then send "showArray" and "sortAscending" to a textfile. "sortAscending(list);" isn't showing anything when running it, and there are no syntax errors.
sortAscending(list);
public static String[] sortAscending(String[] names)
{
String temp;
int passNum, i, result;
for(passNum=1; passNum < 10; passNum++)
{
for(i = 0; i<(10-passNum); i++)
{
result=names[i].compareToIgnoreCase(names[i+1]);
if(result>0)
{
temp=names[i];
names[i]=names[i+1];
names[i+1]=temp;
}
}
}
return names;
Bubble Sort, either try using some good algorithm like Quicksort, or else use an inbuilt function fromjava.utilpackage,Arrays.sort(array);.