Wedge:exit code for process is 1. For loops. Selection Sort

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • acer589
    New Member
    • Apr 2012
    • 1

    #1

    Wedge:exit code for process is 1. For loops. Selection Sort

    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?
Working...