Java Stack

Ads
 

Java Stack

The Stack class works on the principle last-in-first-out (LIFO) stack of objects.

The Stack class works on the principle last-in-first-out (LIFO) stack of objects.

Java Stack

     

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

Ads

Ads