Hey I have this project where the program displays team scores in a descending order but the problem is I can't switch up the team names so they can be in order because the team names array is a string.
for(int i = 0;i<tabPTS.length;i++){ // tabEquipe is the array containing the team names.
for (int j = i+1; j<tabPTS.length;j++){
if(tabPTS[i]<tabPTS[j]){
temp = tabPTS[i];
tabPTS[i] = tabPTS[j];
tabPTS[j] = temp;
}
}
}
System.out.println("Equipes: ");
System.out.println();
System.out.print("\t" + "PJ");
System.out.print("\t" + "V");
System.out.print("\t" + "D");
System.out.print("\t" + "PTS");
System.out.println();
for(int i = 0;i<tabPTS.length;i++){
int pos = i;
System.out.println(tabEquipe[i] + "\t" + tabPJ[i] + "\t"
+ tabVict[i] + "\t" + tabDef[i] + "\t" + tabPTS[i]);
}