The Stack class works on the principle last-in-first-out (LIFO) stack of objects. It extends the Vector class of the legacy classes having five operations allowing a vector to be treated as a stack. Methods push() and pop() are used to pick and insert the objects into the stack respectively, while the method peek for the item at the top on the stack to check whether the stack is empty.
Initially the stack (when it is first created) does not contain any item.
To know more about java stack click on the link:
http:/www.roseindia.net/java/beginners/stack-demo.shtml
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.
Ask Questions? Discuss: Java Stack
Post your Comment