当前位置:网站首页>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); 取中最小值
边栏推荐
- WPF 截图控件之文字(七)「仿微信」
- ssm网页访问数据库数据报错
- Multithreading (Basic) - 40,000 word summary
- Oracle根据时间查询
- 如何在技术上来保证LED显示屏质量?
- 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---Mixins
- 有奖征集|TaoCloud&宝德联合举办全闪POC!
- 【面向校招】Golang面试题合集
- 详细总结SoC、DSP、MCU、GPU和FPGA等基础概念
猜你喜欢
随机推荐
FPGA手撕代码——CRC校验码的多种Verilog实现方式 (2021乐鑫科技数字IC提前批代码编程)
循环语句综合练习
LayaBox---TypeScript---Mixins
Geoffery Hinton: The Next Big Thing in Deep Learning
【2022 小目标检测综述】Towards Large-Scale Small Object Detection: Survey and Benchmarks
STM32+MPU6050 Design Portable Mini Desktop Clock (Automatically Adjust Time Display Direction)
【术语科普】关于集成工作台那些难懂的词儿,看这篇秒懂!
微信小程序---组件开发与使用
LayaBox---TypeScript---Symbols
小程序插件让开发者受益的几个理由
突破边界,华为存储的破壁之旅
循环结构--do-while循环
Outsourced Student Management System Architecture Documentation
LayaBox---TypeScript---迭代器和生成器
ssm web page access database data error
5G基础学习1、5G网络架构、网络接口及协议栈
从幻核疑似裁撤看如何保证NFT的安全
The sitcom "Re-Walking the Long March" was staged
What is the future of smartwatches?
LayaBox---TypeScript---JSX









