企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持知识库和私有化部署方案 广告
## shuffle 打乱集合,必须是List集合. ~~~ ArrayList<Integer> arrayList = new ArrayList<>(); arrayList.add(10); arrayList.add(2); arrayList.add(1); arrayList.add(7); Collections.shuffle(arrayList); System.out.println(arrayList); ~~~ ## sort 对集合进行排序 ~~~ ArrayList<Integer> arrayList = new ArrayList<>(); arrayList.add(10); arrayList.add(2); arrayList.add(1); arrayList.add(7); Collections.sort(arrayList); System.out.println(arrayList); ~~~