home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1998 October A / Pcwk10a98.iso / Inprise / TRIAL / JBUILDER / JSAMPLES.Z / Stack2.java < prev    next >
Text File  |  1998-05-08  |  584b  |  26 lines

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