发布网友
共2个回答
热心网友
这两个方法最大的区别就是返回值不一样,在作用上基本没有区别。 add是实现List接口重写的方法,返回值为boolean。 addElement是Vector类中的特有方法,返回值是void
热心网友
push(E item)
Pushes an item onto the top of this stack.
public boolean add(E e)
Appends the specified element to the end of this Vector.