鲸落的博客

Brain-dumping.

Stack in Java

Stack作为一个LIFO (Last-In-First-Out)是非常重要的数据结构,Java中从最初版本就有了Stack类,但是该类由于是继承自Vector,在Java Collections发布后就被废弃了。

Deques can also be used as LIFO (Last-In-First-Out) stacks. This interface should be used in preference to the legacy Stack class. When a deque is used as a stack, elements are pushed and popped from the beginning of the deque.

Comments