标签:arraylist exce style nbsp 分页 class att opp integer
public static void main(String [] args){ try { List<Integer> skuIdList=new ArrayList<>(); skuIdList.add(1); skuIdList.add(2); skuIdList.add(3); skuIdList.add(4); skuIdList.add(5); List<List<Integer>> choppedList = chopped(skuIdList, 2); for(List<Integer> skuList_page:choppedList){ int c=3; } int a=2; }catch (Exception ex){ int d=3; } } public static <T> List<List<T>> chopped(List<T> list, final int L) { List<List<T>> parts = new ArrayList<List<T>>(); final int N = list.size(); for (int i = 0; i < N; i += L) { parts.add(new ArrayList<T>(list.subList(i, Math.min(N, i + L)))); } return parts; }
标签:arraylist exce style nbsp 分页 class att opp integer
原文地址:https://www.cnblogs.com/caohuimingfa/p/9328142.html