home *** CD-ROM | disk | FTP | other *** search
/ BUG 15 / BUGCD1998_06.ISO / aplic / jbuilder / jsamples.z / Queue2.java < prev    next >
Encoding:
Java Source  |  1997-07-30  |  569 b   |  27 lines

  1. // Copyright(c) 1996,1997 ObjectSpace, Inc.
  2.  
  3. import COM.objectspace.jgl.*;
  4.  
  5. /**
  6.  * Use of List as underlying Sequence.
  7.  *
  8.  * @see COM.objectspace.jgl.Queue
  9.  * @version 2.0.2
  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.