list里面的数据怎么排序

抱只野猫 1个月前 已收到1个回答 举报

烊无的奈习 2星

共回答了73个问题采纳率:91.4% 评论

List<List> list = new ArrayList<List>(); Collections.sort(list, new Comparator<List>(){ //重写排序规则 public int compare(List o1, List o2) { return 0; } });里面那个可以List可以封装成bean,这样就可以在bean里继承Comparator,实现排序方法。一次排序不行可以多次排,关键看你的排序规则要写对。

21小时前

26
可能相似的问题

热门问题推荐

Copyright © 2024 微短问答 All rights reserved. 粤ICP备2021119249号 站务邮箱 service@wdace.com