你直接使用ArrayList或者Vector不就可以了吗?为什么一定要用数组
你可以在最后才把Vector转换成为数组啊

解决方案 »

  1.   

    用java.util.ArrayList.
    ArrayList al = new ArrayList();
    常用添加的方法:
    add(Object o) 
              Appends the specified element to the end of this list.add(int index, Object element) 
              Inserts the specified element at the specified position in this list.
    删除的方法:
    remove(int index) 
              Removes the element at the specified position in this list.removeRange(int fromIndex, int toIndex) 
              Removes from this List all of the elements whose index is between fromIndex, inclusive and toIndex, exclusive.
      

  2.   

    Class001[] aa; 声明了一个 对类数组的引用,
    数组引用时不限大小的,在运行时确定。
    也就是说,
    Class001[] aa;
    Class001[] cc = new Class001[1], bb = new Class001[100];
    aa = cc;
    aa = bb;
    都是合法的。
    数组是定长的,对“数组的引用”可以指向任何长度的数组。如果,是说使用时的数组是动态的,
    那就如上两位所言,使用 Vector ... 。
      

  3.   

    原来自定义的类可以放入Vector里啊,才知道,我以为Vector只能放字符串呢。没看书不好意思:)