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

  1. // Copyright(c) 1996,1997 ObjectSpace, Inc.
  2. import com.objectspace.jgl.adapters.*;
  3. import com.objectspace.jgl.algorithms.*;
  4. import java.util.Vector;
  5.  
  6. /**
  7.  * Sorting a primitive array without iterators.
  8.  *
  9.  * @see com.objectspace.jgl.algorithms.Sorting
  10.  * @version 1.0
  11.  * @author ObjectSpace, Inc.
  12.  */
  13.  
  14. public class Sorting2
  15.   {
  16.   public static void main( String[] args )
  17.     {
  18.     System.out.println( "Sort a primitive array of chars" );
  19.     char c[] = { 'c', 'z', 'e', 'f', 'g', 'o', 'a' };
  20.     CharArray cArray = new CharArray( c );
  21.     System.out.println( "unsorted = " + c );
  22.     Sorting.sort( cArray );
  23.     System.out.println( "sorted   = " + c );
  24.     }
  25.   }
  26.