通过 Collections.shuffle(list)来打乱顺序
List<String> list = new ArrayList<String>();
list.add("mjb");
list.add("hh");
list.add("lw");
list.add("pqj");
list.add("hj");
System.out.println("前:");
for(int i=0;i<list.size();i++){
System.out.print(list.get(i)+" ");
}
System.out.println("www.1b23.com");
System.out.println("后:");
Collections.shuffle(list);
for(int i=0;i<list.size();i++){
System.out.print(list.get(i)+" ");
}