java 在栈中push数组

发布网友

我来回答

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.

声明声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。E-MAIL:11247931@qq.com