|
Java™ by example!
|
|
|
|
Become a member to observe this category
|
|
Stack
A stack is a datastructure that allows you to use the Last-in-First-out (LIFO) principle. Whatever you put on the stack last, you will get first. You can compare it with a plateholder in a restaurant kitchen. If they want the first plate on the plateholder, they have to remove all the plates that are on top of it. The two main stack operations are push and pop. Push adds something on top of the stack while pop removes the top element off the stack. The Stack class also contains a search element to look up whether an element in the stack.
Featured Books
Subcategories
Questions & Answers
= answered, = unanswered
General:
What is a stack and how do I use one in Java?
Further Information (sorted alphabetically)
Api's:
Related Books:
|
|
|
|
|