自定义类实现comparable接口,在集合中可按照此定义进行排序。
想要独立的定义规则去使用 可以采用Collections.sort(List list,Comparetor c)方式。
comparable与comparetor
最新推荐文章于 2022-03-11 21:09:19 发布
自定义类实现comparable接口,在集合中可按照此定义进行排序。
想要独立的定义规则去使用 可以采用Collections.sort(List list,Comparetor c)方式。