I am trying to use Stack
, but I am slightly confused by the terminology.
I find that Stack
class has only push(E e)
as per Java doc.
And has add(E e)
and addAll(Collection<? extends E> c)
as a inherited method from Vector
class.
Do they have the same functionality or is it better to use push(...)
to insert elements to the Stack
object.
In other words, will I encounter any issues if I use add(...)
instead of push(...)
?