String temp ="";
int Count =0;
String[] names = new String[10];
for(int a = 0; a<=9; a++)
{
String name = JOptionPane.showInputDialog("enter name");
names[a]=name;
Count++;
}
System.out.println("Unchanged: "+Arrays.toString(names));
for(int i=0;i<(Count-1);i++)
{
for(int j=(i+1); j<Count;j++)
{
if((names[j].compareTo(names[i]))>0)
{
temp = names[i];
names[i] =names[j];
names[i]=temp;
}
}
}
Hi i'm trying to get this manual sort to work (i know there is a quick sort option but i have to do it this way) and i cannot see what the problem is any suggestions?