我试图用不确定如何做到这一点的收藏来改变音乐曲目。
public void Shuffle()
{
Collections ArrayList<Track>;
}
我用^
开始的答案 0 :(得分:1)
您可以使用Collections.shuffle(列表列表)
更多内容如下: Oracle Documentation
答案 1 :(得分:1)
实施例
public class Random {
public static void main(String[] args) {
List<String> teamList=Arrays.asList("Ananaya", "Mike","James", "Shashwat");
Collections.shuffle(teamList);
int counter=0;
for (String value:teamList){
System.out.println("The build schedule for week "+ ++counter + " is to be done by "+value);
}
}
}