假设我有这样的课程:
public class EnglishWords {
private final String word1;
private final String word2;
private final String word3;
private final String word4;
public EnglishWords(String word1Arg, String word2Arg, String word3Arg, String word4Arg) {
this.word1 = word1Arg;
this.word2 = word2Arg;
this.word3 = word3Arg;
this.word4 = word4Arg;
}
public String getword1() {
return word1;
}
public String getword2() {
return word2;
}
public String getword3(){
return word3;
}
public String getword4(){
return word4;
}
}
我创建一个这样的对象:
EnglishWords englishWords = new EnglishWords(words.get(0),
words.get(1), words.get(2), wordPair.getEnglishWord());
是否有某种排序方法可以添加到对成员进行随机排序的类中,以便它们随机排序?