StackE


Stack<E> java.util

Java 1.0 cloneable serializable collection

This class implements a last-in-first-out (LIFO) 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. In Java 1.2, you can instead use a LinkedList as a stack.

Figure 16-58. java.util.Stack<E>

 public class  Stack<E>  extends Vector<E> {  // Public Constructors  public  Stack  ( );  // Public Instance Methods  public boolean  empty  ( );        public E  peek  ( );  synchronized  public E  pop  ( );  synchronized  public E  push  (E  item  );        public int  search  (Object  o  );  synchronized  } 



Java In A Nutshell
Java In A Nutshell, 5th Edition
ISBN: 0596007736
EAN: 2147483647
Year: 2004
Pages: 1220

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net