home *** CD-ROM | disk | FTP | other *** search
/ ActiveX Programming Unleashed CD / AXU.iso / jgl_1_1 / jgl_1_1.exe / examples / Stack2.java < prev    next >
Encoding:
Java Source  |  1996-09-10  |  542 b   |  27 lines

  1. // Copyright(c) 1996 ObjectSpace, Inc.
  2.  
  3. import jgl.*;
  4.  
  5. /**
  6.  * Using a Vector as the underlying Sequence.
  7.  * <p>
  8.  * @see jgl.Stack
  9.  * @version 1.1
  10.  * @author ObjectSpace, Inc.
  11.  */
  12.  
  13. public class Stack2
  14.   {
  15.   public static void main( String[] args )
  16.     {
  17.     // Use a Array as the underlying data structure.
  18.     Stack stack = new Stack( new Array() ); 
  19.     stack.push( "bat" );
  20.     stack.push( "cat" );
  21.     stack.push( "dog" );
  22.  
  23.     System.out.println( "Print the Stack." );
  24.     System.out.println( stack );
  25.     }
  26.   }
  27.