home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
BUG 15
/
BUGCD1998_06.ISO
/
aplic
/
jbuilder
/
jsamples.z
/
Filling1.java
< prev
next >
Wrap
Text File
|
1997-07-30
|
1KB
|
40 lines
// Copyright(c) 1996,1997 ObjectSpace, Inc.
import COM.objectspace.jgl.*;
/**
* Filling a sequence with a single element and multiple elements.
*
* @see COM.objectspace.jgl.Filling
* @version 2.0.2
* @author ObjectSpace, Inc.
*/
public class Filling1
{
public static void main( String[] args )
{
int intArray[] = new int[ 10 ];
System.out.println( "Fill a native array of integers with 42" );
IntIterator begin = IntIterator.begin( intArray );
IntIterator end = IntIterator.end( intArray );
Filling.fill( begin, end, new Integer( 42 ) );
Printing.println( begin, end );
System.out.println();
Array array = new Array();
array.add( "cat" );
array.add( "dog" );
array.add( "emu" );
array.add( "fox" );
System.out.println( "array = " + array );
System.out.println( "Fill the array with gnu" );
Filling.fill( array, "gnu" );
System.out.println( "array = " + array );
System.out.println( "Fill the first 3 elements with bat." );
Filling.fillN( array.begin(), 3, "bat" );
System.out.println( "array = " + array );
}
}