[java笔记]动态数组

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++;

posted @ 2015-01-14 19:45  julyme  阅读(132)  评论(0编辑  收藏  举报