当前位置:网站首页>List排序 ,取最大值最小值
List排序 ,取最大值最小值
2022-08-02 11:08:00 【左--右】
List排序 ,取最大值最小值
public static void main(String[] args) {
List list = Arrays.asList(5,2,3,1,9);
int N = list.size();
int t = 0;
Collections.sort(list);
System.out.println("顺序--"+list);
Collections.reverse(list);
System.out.println("倒叙--"+list);
Collections.shuffle(list);
System.out.println("随机--"+list);
}
Integer max = Collections.max(iList); 取中最大值
Integer max = Collections.min(iList); 取中最小值
边栏推荐
- C#/VB.NET 添加多行多列图片水印到Word文档
- LayaBox---TypeScript---迭代器和生成器
- After 21 years of graduation, I switched to software testing. From 0 income to a monthly salary of over 10,000, I am really lucky...
- LayaBox---TypeScript---Iterator and generator
- 从幻核疑似裁撤看如何保证NFT的安全
- 配置mysql失败了,这是怎么回事呢?
- LayaBox---TypeScript---Three slash instructions
- 为什么要使用BGP?
- 博云入选Gartner中国DevOps代表厂商
- 【2022 小目标检测综述】Towards Large-Scale Small Object Detection: Survey and Benchmarks
猜你喜欢
随机推荐
爆款视频怎么做?这里或许有答案!
流动性质押挖矿系统开发如何制作?单双币系统开发成熟技术
循环结构--do-while循环
暑期总结3
“纯C”实现——三子棋小游戏
Excel动态图制作
多线程之生产者与消费者
10份重磅报告 — 展望中国数字经济未来
MySql模糊查询大全
LayaBox---TypeScript---迭代器和生成器
MSYS2 QtCreator Clangd code analysis can not find mm_malloc.h problem remedy
华为eNSP(基础实验通信)
WPF 截图控件之文字(七)「仿微信」
LeetCode每日一练 —— 20. 有效的括号
LayaBox---TypeScript---声明合并
What is the future of smartwatches?
LayaBox---TypeScript---Three slash instructions
多线程(基础) - 4万字总结
从众多接口中脱颖而出的最稳定的接口——淘宝详情api
Several reasons why applet plugins benefit developers









