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

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