Java in a Nutshell

Previous Chapter 30
The java.util Package
Next
 

30.22 java.util.Stack (JDK 1.0)

This class implements a last-in-first-out stack of objects. push() puts an object on the top of the stack. pop() removes and returns the top object from the stack. peek() returns the top object without removing it.

public class Stack extends Vector {
    // Default Constructor: public Stack()
    // Public Instance Methods
            public boolean empty();
            public synchronized Object peek();
            public synchronized Object pop();
            public Object push(Object item);
            public synchronized int search(Object o);
}

Hierarchy:

Object->Vector(Cloneable, Serializable)->Stack


Previous Home Next
java.util.SimpleTimeZone (JDK 1.1) Book Index java.util.StringTokenizer (JDK 1.0)

Java in a Nutshell Java Language Reference Java AWT Java Fundamental Classes Exploring Java