FileDocCategorySizeDatePackage
Array4.javaAPI DocExample941Sat Sep 12 03:01:00 BST 1998None

Array4

public class Array4 extends Object
Reserving capacity.
see
com.objectspace.jgl.Array
version
3.0.0
author
ObjectSpace, Inc.

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] args)

    Object ints[] = { "bat", "cat", "dog" };
    Array array = new Array( ints );
    array.put( 1, "CAT" );
    System.out.println( "array = " + array + ", capacity = " + array.capacity() );
    System.out.print( "array = " );
    for ( int i = 0; i < ints.length; i++ )
      System.out.print( ints[ i ] + " " );
    System.out.println();

    array.ensureCapacity( 100 );
    array.put( 2, "DOG" );
    System.out.println( "array = " + array + ", capacity = " + array.capacity() );
    System.out.print( "array = " );
    for ( int i = 0; i < ints.length; i++ )
      System.out.print( ints[ i ] + " " );
    System.out.println();