home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
BUG 15
/
BUGCD1998_06.ISO
/
aplic
/
jbuilder
/
jsamples.z
/
Sequences1.java
< prev
next >
Wrap
Text File
|
1997-07-30
|
1KB
|
31 lines
// Copyright(c) 1996,1997 ObjectSpace, Inc.
import COM.objectspace.jgl.*;
public class Sequences1
{
public static void main( String[] args )
{
Array array = new Array();
array.pushBack( "bat" ); // Add to end of array.
array.add( "cat" ); // Synonym for pushBack().
array.pushFront( "ape" ); // Insert at beginning of array.
System.out.println( "array = " + array );
System.out.println();
System.out.println( "Demonstrate access" );
System.out.println( "array.at( 0 ) = " + array.at( 0 ) );
System.out.println( "array.front() = " + array.front() );
System.out.println( "array.at( 2 ) = " + array.at( 2 ) );
System.out.println( "array.back() = " + array.back() );
System.out.println( "array.put( 1, \"fox\" )" );
array.put( 1, "fox" );
System.out.println( "array = " + array );
array.popFront();
System.out.println( "After popFront() = " + array );
array.popBack();
System.out.println( "After popBack() = " + array );
}
}