/**
* 动态添加到数组
* @param custom
* @param name
*/
public void addName(Object[] custom,Object name) {
//添加姓名
if(custom==null) { //若数组为空,定义数组的长度为1
custom=new Object[1];
custom[0]=name;
} else {
//若数组不为空,把数组复制出一个新的,在原数组的基础上加1
Object[] copy=Arrays.copyOf(custom, custom.length+1);
//把原先数组制空
custom=null;
//把新数组给原先这个数组
custom=copy;
custom[custom.length-1]=name;
}
}