I have an array of objects populated by a .txt file
Object[] punteggiTutti = scores.toArray();
Even if it's possible to use the .sort function:
Arrays.sort(punteggiTutti, Collections.reverseOrder());
I would know how to apply a working bubblesort algorithm; I tried the following not working code:
for(int i=0; i<j; i++)
{
if(punteggiTutti[i]<punteggiTutti[i+1]) // error "<" operator cannot be used in objects
{
temp=punteggiTutti[i];
punteggiTutti[i]=punteggiTutti[i+1];
punteggiTutti[i+1]=temp;
}
}