Stack 继承 Vector, Vector是线程安全的,每个方法都是 Synchronized关键字。
方法:
push Pushes an item onto the top of this stack
pop Removes the object at the top of this stack and returns that object as the value of this function.
peek Looks at the object at the top of this stack without removing it from the stack.
Queue 接口, ArrayQueue 实现Queue
方法:
add
offer
poll Retrieves and removes the head of this queue,or returns {@code null} if this queue is empty.
element Retrieves, but does not remove, the head of this queue. This method differs from {@link #peek peek} only in that it throws an exception if this queue is empty.
peek Retrieves, but does not remove, the head of this queue,or returns {@code null} if this queue is empty.