有 3 种方法可以实现, 1、Collections.sort 排序重写 compare方法 2、实现Comparable接口 3、通过自定义比较器类的方式实现排序
博客园 © 2004-2025 浙公网安备 33010602011771号 浙ICP备2021040463号-3