So a Stack is just a data structure that follows the Last In First Out rule (LIFO). This means that the last item placed on the stack (with an add or push method of some description) will be the next to be removed (by a call to a remove or pop method).
The Java API provides a basic Stack class that you can use (in the java.util package).
There are no stupid questions, only those too stupid to ask for help.
echo is a web developer's best friend.