使用apache common collection
List<Integer> intList = Lists.newArrayList(1, 2, 3, 4, 5, 6, 7, 8); List<List<Integer>> subs = ListUtils.partition(intList, 3);
使用apache common collection
List<Integer> intList = Lists.newArrayList(1, 2, 3, 4, 5, 6, 7, 8); List<List<Integer>> subs = ListUtils.partition(intList, 3);