/**
* 把一个列表(数组)一组一组的切分
* 主要关注这个方法的底层变动 Lists.partition
* @param args
*/
public static void main(String[] args) {
//1.初始化Integer类型列表
List<Integer> IntegerList = Lists.newArrayList();
//2.赋值给这个列表
for (int i = 0; i < 16; i++) {
IntegerList.add(i);
}
//3.进行5个一组的切分
List<List<Integer>> listList = Lists.partition(IntegerList, 5);
//4.输出
System.err.println(listList);
}
把一个列表(数组)一组一组的切分
最新推荐文章于 2023-06-06 01:25:02 发布