All Packages  Class Hierarchy  Previous  Next  Index

Printing Examples

Printing 1 - Printing an JGL container and a native array of primitives.


Printing1 Example Code

// Copyright(c) 1996,1997 ObjectSpace, Inc.

import COM.objectspace.jgl.*;

/**
 * Printing an JGL container and a native array of primitives.
 *
 * @see COM.objectspace.jgl.Printing
 * @version 2.0.2
 * @author ObjectSpace, Inc.
 */

public class Printing1
  {
  public static void main( String[] args )
    {
    String[] strings = { "gnu", "emu", "dog" };
    ObjectIterator objectBegin = ObjectIterator.begin( strings );
    ObjectIterator objectEnd = ObjectIterator.end( strings );
    System.out.println( "strings = " + Printing.toString( objectBegin, objectEnd ) );
    System.out.print( "strings = " );
    Printing.println( objectBegin, objectEnd );

    int[] ints = { 3, 4, 7 };
    IntIterator intBegin = IntIterator.begin( ints );
    IntIterator intEnd = IntIterator.end( ints );
    System.out.println( "ints = " + Printing.toString( intBegin, intEnd ) );
    System.out.print( "ints = " );
    Printing.println( intBegin, intEnd );
    }
  }

Printing1 Example Output

strings = ( gnu, emu, dog )
strings = ( gnu, emu, dog )
ints = ( 3, 4, 7 )
ints = ( 3, 4, 7 )

All Packages  Class Hierarchy  Previous  Next  Index