home *** CD-ROM | disk | FTP | other *** search
Java Source | 1996-09-10 | 542 b | 27 lines |
- // Copyright(c) 1996 ObjectSpace, Inc.
-
- import jgl.*;
-
- /**
- * Using a Vector as the underlying Sequence.
- * <p>
- * @see jgl.Stack
- * @version 1.1
- * @author ObjectSpace, Inc.
- */
-
- public class Stack2
- {
- public static void main( String[] args )
- {
- // Use a Array as the underlying data structure.
- Stack stack = new Stack( new Array() );
- stack.push( "bat" );
- stack.push( "cat" );
- stack.push( "dog" );
-
- System.out.println( "Print the Stack." );
- System.out.println( stack );
- }
- }
-