有一组对象,每一个对象都存储了很多值,
class PlayerScores {
String playerName;
int pos=0;
int played=0;
int win=0;
int draw=0;
int lose=0;
int goalsFor=0;
int goalsAgainst=0;
int goalDifference=0;
int points=0;
public PlayerScores() {
}
}
这些都保存在数组中。
Player Scores[] playersObjects = new PlayerScores[int];
playersObjects[i] = new PlayerScores();
我需要新建一个对象数组,进行搜索playersObject[]
,然后再排序,最高分排在第一然后降序。不知道怎么样在一个对象中进行排序,请高手指教。谢谢