private int count;//计数器private int ary[] = new int [3];if(count >= ary.length){//数组动态扩展int newlen = (ary.length*3)/2 + 1;underwears = Arrays.copyOf(ary, newlen);}count++;