these are the loops i used:
here's the part with the error:
and i can't find a way how to substitute it or anything..or is there any simplified way to sort string arrays in alphabetical order? i really need help...
Code:
for (h = 0; h<name.length;h++)
{
highestOrder [h] = Integer.valueOf(name[h].charAt(0));
highestName [h] = name[h];
for (int count = 0; count<name.length;count++) {
if (Integer.valueOf(name[count].charAt(0)) < highestOrder[h])
{
highestOrder[h] = Integer.valueOf(name[count].charAt(0));
temporary = Integer.valueOf(name[h].charAt(0));
Integer.valueOf(name[h].charAt(0))= Integer.valueOf(name[count].charAt(0));
Integer.valueOf(name[count].charAt(0))= temporary;
highestName[h] = name[count];
tmp = name[h];
name[h] = name[count];
name[count] = tmp;
}
}
}
for (int count=0; count<name.length;count++)
{
System.out.println(highestOrder[count] + " ");
System.out.println(highestName[count] + " ");
}
Code:
temporary = Integer.valueOf(name[h].charAt(0)); Integer.valueOf(name[h].charAt(0))= Integer.valueOf(name[count].charAt(0)); Integer.valueOf(name[count].charAt(0))= temporary;
Comment