January 2002
Intermediate to advanced
264 pages
8h 3m
English
java.util.Stack
This class is identical to the J2SE Stack class.
It extends the Vector class to allow a simple
Last-In-First-Out (LIFO) stack, where elements are placed on the top
of the stack using the push() method and removed
from the top using the pop() method.
peek() returns the object at the top of the stack
without actually removing it. search() will search
the stack for the specified object, returning the index of the
element if found or -1 if it is not found.
public classStackextends java.util.Vector { // constructor publicStack(); // public instance methods public booleanempty(); public Objectpeek(); public Objectpop(); public Objectpush(Object item); public intsearch(Object o); }
Read now
Unlock full access