如下所示:
/**
* ArraySplit.java
* Copyright(C) 2014
*/
package com.udpdemo.test2;
import java.util.ArrayList;
import java.util.List;
/**
*
* @author cuiran
* @version 1.0.0
*/
public class ArraySplit {
/**
* @param args
*
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
int[] ary = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20};//要分割的数组
int splitSize = 5;//分割的块大小
Object[] subAry = splitAry(ary, splitSize);//分割后的子块数组
for(Object obj: subAry){//打印输出结果
int[] aryItem = (int[]) obj;
for(int i = 0; i < aryItem.length; i++){
System.out.print(aryItem[i] + “, “);
}
System.out.println();