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! :)
不建议再使用这个类,强烈建议使用ArrayList! :)
为了保持一致,继续用它,而不是 ArrayList
把LinkedList 硬编码了除了new以外,其他地方用List,就可以随时改用LinkedList与ArrayList