我需要对名为studentsList的学生的arraylist进行排序,他们拥有不同的分数,如行为,阅读,数学。
public class Student{
private String name;
int behaviorScore;
int readingScore;
int mathScore;
}
我为每个属性创建了默认构造函数,getter和setter。
有一个字符串的arraylist,它将存储名为priorityList的字符串,该字符串将存储基于studentList需要排序的顺序。 priorityList的元素将动态添加。
例如,让priorityList看起来如下所示 { “行为”, “读”, “数学”}
现在,我需要根据priorityList中的顺序对studentsList中的学生进行排序。
任何人,请帮助解决这个排序问题。
提前致谢。