他们两个唯一不同的就是 返回值,
addElement(Object obj)在添加成功后 返回 true
其他的都是一样的

解决方案 »

  1.   

    add 返回boolean ,addElement 返回 void。这是jdk doc里关于addElement的说法Adds the specified component to the end of this vector, increasing its size by one. The capacity of this vector is increased if its size becomes greater than its capacity. This method is identical in functionality to the add(Object) method (which is part of the List interface). 
    不建议再使用这个类,强烈建议使用ArrayList!  :)
      

  2.   

    不建议再使用这个类,强烈建议使用ArrayList! 是的
      

  3.   

    但是我看了add(object 0) 的实现,感觉无论成功与否,都会返回真呀!
      

  4.   

    我很头晕,现在我代码里的 基本都用的是  LinkedList 
    为了保持一致,继续用它,而不是 ArrayList
      

  5.   

    bigc2000(勇者无惧) 
    把LinkedList 硬编码了除了new以外,其他地方用List,就可以随时改用LinkedList与ArrayList