集合分批次处理(分页)

package may_cur_uat;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author: huangshun
 * @Date: 2019/11/29 18:33
 * @Version 1.0
 */
public class AAA {
    public static void main(String[] args) throws Exception {
        final int total = 1000;//总数
        final int pageSize = 300;//每页15
        final int pageNumber = total % pageSize == 0 ? total / pageSize : (total / pageSize) + 1;//总页数

        List list = new ArrayList<>();

        for (int i = 1;i<=total;i++){
            list.add(i);
        }
        for (int i = 0; i

 

你可能感兴趣的:(java,EE)