int total = list.size();
List<Contract> sub = list.subList((currPage-1) * pageSize > total ? total : (currPage-1) * pageSize,
currPage * pageSize > total ? total : currPage * pageSize);
List 分页
最新推荐文章于 2024-07-13 15:02:00 发布
本文介绍了一种基于Java的分页查询实现方法。通过计算列表总大小,并使用subList方法来获取指定页数的数据子集。这种方法适用于需要进行分页显示的应用场景。
3648

被折叠的 条评论
为什么被折叠?



