So, I keep getting "wedge2: exit code for process is 1."
public static String[] alphaName(Strin g[] nameList)
{
String temp="",low="";
int lowest=0, current=0;
for(int i=0; i<nameList.leng th-1;i++)
{
current=i;
low=nameList[i];
for (int j=i+1; j<nameList.leng th;j++)
{
if(nameList[j].compareTo(low) <0)
{
low=nameList[j];
current=j;
}
}
nameList[current]=nameList[i];
nameList[i]=low;
}
return nameList;
}
My for loop looks like that and it is encountering the problem at the compareTo(). Any suggestions?
public static String[] alphaName(Strin g[] nameList)
{
String temp="",low="";
int lowest=0, current=0;
for(int i=0; i<nameList.leng th-1;i++)
{
current=i;
low=nameList[i];
for (int j=i+1; j<nameList.leng th;j++)
{
if(nameList[j].compareTo(low) <0)
{
low=nameList[j];
current=j;
}
}
nameList[current]=nameList[i];
nameList[i]=low;
}
return nameList;
}
My for loop looks like that and it is encountering the problem at the compareTo(). Any suggestions?