home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1998 October
/
PCWorld_1998-10_cd.bin
/
software
/
prehled
/
inprise
/
JSAMPLES.Z
/
Iterators9.java
< prev
next >
Wrap
Text File
|
1998-05-08
|
771b
|
28 lines
// Copyright(c) 1996,1997 ObjectSpace, Inc.
import com.objectspace.jgl.*;
import com.objectspace.jgl.algorithms.*;
import com.objectspace.jgl.util.*;
import java.util.Enumeration;
public class Iterators9
{
public static void main( String[] args )
{
Array array = new Array();
array.add( "ape" );
array.add( "bat" );
array.add( "cat" );
OutputStreamIterator output = new OutputStreamIterator( System.out );
Enumeration input = array.elements();
while ( input.hasMoreElements() )
output.put( input.nextElement() );
System.out.println(); // Flush output.
// You can use an algorithm to do the same thing.
Copying.copy( array, output );
System.out.println(); // Flush output.
}
}